On Jul 16, 1:00 pm, Taxman wrote:
> T.is_isomorphic(P)
> gives the desired result of true.
Ah sorry,
P=graphs.PetersenGraph()
being the P in question if anyone was curious.
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
On Jul 16, 12:26 pm, javier wrote:
> You need to define a function on pair of vertices that returns "True"
> if there should be an edge.
>
> Something like
>
> X = Set([1,2,3,4,5])
> V=(X.subsets(2))
>
> def s(a,b):
> return a.intersection(b).cardinality()==0
>
> T = Graph([V, s])
>
> should
Ok, my own mistake. The problem is that V (the set of sets) needs to
be turned into a list. This works for me now:
X = Set([1,2,3,4,5])
V = list(X.subsets(2))
def s(a,b):
return a.intersection(b).cardinality()==0
T = Graph([V, s])
Hope that helps
Cheers
Javier
On Jul 16, 5:26 pm, javier
You need to define a function on pair of vertices that returns "True"
if there should be an edge.
Something like
X = Set([1,2,3,4,5])
V=(X.subsets(2))
def s(a,b):
return a.intersection(b).cardinality()==0
T = Graph([V, s])
should work, but I am getting the following weird error in sage 4.