#14099: Adding Method for testing avoidance in posets
------------------------------------------------------+---------------------
Reporter: chrisjamesberg | Owner: rowland
Type: enhancement | Status: new
Priority: minor | Milestone: sage-5.7
Component: combinatorics | Resolution:
Keywords: posets | Work issues:
Report Upstream: N/A | Reviewers: saliola
Authors: chrisjamesberg, rowland, ahmorales | Merged in:
Dependencies: | Stopgaps:
------------------------------------------------------+---------------------
Comment (by ncohen):
you definitely need to use `induced = True`, but not on the digraphs. As I
said you need to work on their transitive closure :
{{{
def test(g,n,m):
n = 3
m = 1
pattern = digraphs.Circuit(n+1); pattern.delete_vertex(n)
pattern += digraphs.Circuit(m+1); pattern.delete_vertex(n+m-1)
c =
g.transitive_closure().subgraph_search(pattern.transitive_closure(),
induced = True)
if c:
print "Pattern found with chains", c.connected_components()
else:
print "No pattern in this graph"
g = DiGraph({0 : [], 1 : [2, 3], 2 : [3]})
test(g,3,1)
}}}
Nathann
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14099#comment:8>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" 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-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.