If you consider the documentation of the function you will see

def is_subgraph(self, other, induced=True):
    """
    Tests whether ``self`` is a subgraph of ``other``.

     .. WARNING::

        Please note that this method does not check whether ``self``
        contains a subgraph *isomorphic* to ``other``, but only if it
        directly contains it as a subgraph !

Now your two triangles have labels 0,1,4 and 2,3,5. Which are different
from the one in "ExSW". So this method returns False as expected.

You can access the documentation of any function in Sage with the
question mark (and with two you access the source code).

sage: h.is_subgraph?

Vincent

On 02/05/15 09:13, Craig E Larson wrote:
> Graph("E`oo") is the disjoint union of 2 triangles. Graph("ExSW") is two 
> triangles with 2 more edges connecting them. So the first graph is a 
> subgraph (a non-induced subgraph) of the second graph. But Sage reports 
> that it is not. Both graphs have order 6.
> 
> sage: h=Graph("E`oo")
> sage: g=Graph("ExSW")
> sage: h.is_subgraph(g,induced=False)
> False
> 
> This behavior is in "Sage Version 6.5, Release Date: 2015-02-17".
> 
> 
> 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to