g1=Graph[{UndirectedEdge[a,b]}];
GraphQ[g1]
(*
OUT: True
*)
(*Needs["Combinatorica`"]*)
PlanarQ[g1]
(*
OUT: PlanarQ[.-.]
*)
Combinatorica`PlanarQ[g1]
(*
OUT: Combinatorica`PlanarQ[.-.]
*)
Why doesn't PlanarQ give back "True" or "False" ?
Your graph is not a Combinatorica
graph, rather it is a System
graph. You'll need to specify the contexts explicitly.
Needs["GraphUtilities`"];
g1 = System`Graph[{UndirectedEdge[a, b]}];
Combinatorica`PlanarQ[
GraphUtilities`ToCombinatoricaGraph[g1]]
This returns True
but, in general, this process is a pain and rather buggy. I believe that Combinatorica
is on the way out and I'd recommend trying to get by without.
You probably need:
Needs["GraphUtilities`"]
Needs["Combinatorica`"]
cg1 = ToCombinatoricaGraph[g1];
PlanarQ[cg1]
I don't have v8 to check, however.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With