#17804: Cleanup of sage.graphs.pq_trees
----------------------------+---------------------------------
Reporter: ncohen | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: sage-6.6
Component: graph theory | Keywords:
Merged in: | Authors: Nathann Cohen
Reviewers: | Report Upstream: N/A
Work issues: | Branch:
Commit: | Dependencies:
Stopgaps: |
----------------------------+---------------------------------
While fixing the bug reported at #17787, I noticed several things in
`sage.graphs.pq_trees` that should be cleaned. Some misnamed functions,
hard-to-read documentation, and also a couple of simple but useful missing
features that can be very helpful when debugging code.
This branch consists of several commits which do the following:
- Rename `.cardinality` to `.number_of_children`: the `PQ`-trees encode a
set of permutations, and the 'cardinality' function should represent that,
instead of what it represents now.
- Add a real `.cardinality` function, which can be used to compute the
number of different representations of an interval graph
- Add a `.orderings` function, which lists all possibles representations
of an interval graph
- remove `.is_P` and `.is_Q`. These functions were barely used in the code
itself, and can be replaced with `isinstance(x,P)` and `isinstance(x,Q)`.
- Move the documentation of class PQ-tree, which actually explains how the
main algorithm works, into the module's doc. It is also rewritten, and
hopefully easier to understand.
- Some one-line changes that improve readability or add links.
Nathann
--
Ticket URL: <http://trac.sagemath.org/ticket/17804>
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.
For more options, visit https://groups.google.com/d/optout.