0
$\begingroup$

If we have a bipartite,we can change its form into a normal form like this

g1 = GraphData[{8, 579}]

Mathematica graphics

Graph[g1, GraphLayout -> "BipartiteEmbedding", VertexLabels -> "Name"]

Mathematica graphics

But in this graph this method does not work

g = GraphData[{"CubicTransitive", 20}]

Mathematica graphics

Graph[g, GraphLayout -> "BipartiteEmbedding", VertexLabels -> "Name"]

Mathematica graphics

But we can see this two both is bipartite

BipartiteGraphQ /@ {g1, g}

{True, True}

And you can find a lot of graph cannot convert into "normal form" like this

{Graph[GraphData[#], GraphLayout -> "BipartiteEmbedding", 
    VertexLabels -> "Name"]} & /@ GraphData["Bipartite"][[;; ;; 100]]

Is a bug of Mathematica??

$\endgroup$
3
  • $\begingroup$ Using EdgelList@g rather than g as the first argument, i.e., Graph[EdgeList@g, GraphLayout -> "BipartiteEmbedding", VertexLabels -> "Name"] gives what is expected. $\endgroup$
    – kglr
    Commented Apr 6, 2016 at 18:15
  • $\begingroup$ @kglr It seem I post a ridiculous post.If you don't mind,I'll delete this post.:). But why we can change the g1 like that? $\endgroup$
    – yode
    Commented Apr 6, 2016 at 18:21
  • $\begingroup$ it is indeed puzzling that Graph[g1, ...] works in version 10 (it doesn't in v9). $\endgroup$
    – kglr
    Commented Apr 6, 2016 at 18:41

1 Answer 1

2
$\begingroup$

GraphData[{"CubicTransitive", 20}] sets VertexCoordinates and VertexCoordinates has higher priority than GraphLayout (options section in Graph documentation).

g = GraphData[{"CubicTransitive", 20}];
Options[g]

{VertexCoordinates -> {{1., 0.}, {0.5, 0.866}, {-0.5, 0.866}, {-1., 0.}, {-0.5, -0.866}, {0.5, -0.866}, {1.5, 0.}, {0.75, 1.299}, {-0.75, 1.299}, {-1.5, 0.}, {-0.75, -1.299}, {0.75, -1.299}, {2., 0.}, {1., 1.732}, {-1., 1.732}, {-2., 0.}, {-1., -1.732}, {1., -1.732}}}

g2 = Graph[g, GraphLayout -> "BipartiteEmbedding", 
   VertexLabels -> "Name"];

Options[g2]

{GraphLayout -> {"Dimension" -> 2, "VertexLayout" -> "BipartiteEmbedding"}, VertexCoordinates -> {{1., 0.}, {0.5, 0.866}, {-0.5, 0.866}, {-1., 0.}, {-0.5, -0.866}, {0.5, -0.866}, {1.5, 0.}, {0.75, 1.299}, {-0.75, 1.299}, {-1.5, 0.}, {-0.75, -1.299}, {0.75, -1.299}, {2., 0.}, {1., 1.732}, {-1., 1.732}, {-2., 0.}, {-1., -1.732}, {1., -1.732}}, VertexLabels -> {"Name"}}

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.