Skip to content

Digraph(Graph(G)) may not return a graph isomorphic to G #850

@bojankuzma000

Description

@bojankuzma000

When I construct a complete bipartite digraph $K_{1,5}$ and then turn it into a Grape package Graph, and then back into a Digraphs package Digraph, I would expect to get an isomorphic digraph. But apparently not so.

gap> G:=CompleteBipartiteDigraph(1,5); 
<immutable complete bipartite digraph with bicomponent sizes 1 and 5>
gap> IsomorphismDigraphs(Digraph(Graph(G)),G);
fail

Even the adjacency matrix is different. The following

gap> Display(AdjacencyMatrix(G));
[ [  0,  1,  1,  1,  1,  1 ],
  [  1,  0,  0,  0,  0,  0 ],
  [  1,  0,  0,  0,  0,  0 ],
  [  1,  0,  0,  0,  0,  0 ],
  [  1,  0,  0,  0,  0,  0 ],
  [  1,  0,  0,  0,  0,  0 ] ]

is as expected for the bipartite digraph G. But:

gap> Display(AdjacencyMatrix(Digraph(Graph(G))));
[ [  0,  1,  1,  1,  1,  1 ],
  [  1,  0,  1,  1,  1,  1 ],
  [  1,  1,  0,  1,  1,  1 ],
  [  1,  1,  1,  0,  1,  1 ],
  [  1,  1,  1,  1,  0,  1 ],
  [  1,  0,  0,  0,  0,  0 ] ]

is a different adjacency matrix. Why?

Bojan

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA label for issues that are bugs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions