Dear Robert

If you look at the help message for is_transitive() then you see that the
definition is this: A digraph is transitive if for any pair of vertices u,v
in G linked by a uv-path the edge uv belongs to G.

Cheers
Nico


2014-02-07 19:35 GMT+01:00 Robert <[email protected]>:

> A student in my discrete structures course found what he thinks is a bug
> in Sage's treatment of directed graphs. Consider the relation given by the
> Python dictionary:
>
> {0: [1], 1: [0], 2: [3], 3: [2]}
>
> So 0 is related to 1 and vice versa, and 2 is related to 3 and vice versa.
> This is NOT a transitive relation, because if it were, then 0 would have to
> be related to itself. (I.e. there would be a loop on the directed graph at
> 0.)
>
> However, when you enter the following code:
>
> *r = {0: [1], 1: [0], 2: [3], 3: [2]} *
> *g = DiGraph(r)*
> *g.is_transitive()*
>
> ...you get "True". Is this because is_transitive has a bug; because Sage
> doesn't like its directed graphs to have loops; because the is_transitive
> method is using a different definition of "transitive" than we are*, or
> what?
>
> Thanks in advance!
> Robert
>
> * For example it could be using a definition of transitive that says "For
> all DISTINCT a,b,c in A, if (a,b) and (b,c) then (a,c)." I don't know.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-edu" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sage-edu.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-edu" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-edu.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to