Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I get the following trace, in which 0,2 and 4 are contiguous.

sage: from sage.graphs.pq_trees import P
sage: pqtree=P([[3, 5, 7],[4, 7], [1, 7], [3], [6],[0, 1, 3, 4],[0, 6], [0, 2, 5],[2], [2, 6]])
sage: pqtree
('P', [{3, 5, 7}, {4, 7}, {1, 7}, {3}, {6}, {0, 1, 3, 4}, {0, 6}, {0, 2, 5}, {2}, {2, 6}])
sage: pqtree.set_contiguous(0)
(1, True)
sage: pqtree.set_contiguous(2)
(1, True)
sage: pqtree.set_contiguous(4)
(1, True)
sage: pqtree
('P', [{3, 5, 7}, {1, 7}, {3}, {6}, ('Q', [('P', [{2}, {2, 6}]), {0, 2, 5}, {0, 6}, {0, 1, 3, 4}, {4, 7}])])

Perhaps your problem can be solved by using the latest version?