#10874: Add support for keep_labels in
Digraph.strongly_connected_components_digraph
---------------------------------+------------------------------------------
Reporter: nthiery | Owner: jason, ncohen, rlm
Type: enhancement | Status: positive_review
Priority: major | Milestone: sage-4.7
Component: graph theory | Keywords: strongly connected components
Author: Nicolas M. ThiƩry | Upstream: N/A
Reviewer: Nathann Cohen | Merged:
Work_issues: |
---------------------------------+------------------------------------------
Old description:
> With keep_labels=True, the method
> Digraph.strongly_connected_components_digraph keeps the label on edges
> when contracting strongly connected components, and returns a multi-
> digraph::
> {{{
> sage: g = DiGraph({0:{1:"0-12", 2: "0-12", 3: "0-3"}, 1: {2:
> "1-2", 3: "1-3"}, 2:{1: "2-1", 3: "2-3"}})
> sage: scc_digraph =
> g.strongly_connected_components_digraph(keep_labels = True)
> sage: scc_digraph.edges()
> [({0}, {3}, "0-3"), ({0}, {1, 2}, '0-12'),
> ({1, 2}, {3}, '1-3'), ({1, 2}, {3}, '2-3'),
> ({1, 2}, {1, 2}, '1-2'), ({1, 2}, {1, 2}, '2-1')]
> }}}
>
> APPLY:
>
> * trac_10874-graph-strongly_connected_componnents-nt.patch
> * trac_10874-reviewer.patch
New description:
With keep_labels=True, the method
Digraph.strongly_connected_components_digraph keeps the label on edges
when contracting strongly connected components, and returns a multi-
digraph::
{{{
sage: g = DiGraph({0:{1:"0-12", 2: "0-12", 3: "0-3"}, 1: {2:
"1-2", 3: "1-3"}, 2:{1: "2-1", 3: "2-3"}})
sage: scc_digraph =
g.strongly_connected_components_digraph(keep_labels = True)
sage: scc_digraph.edges()
[({0}, {3}, "0-3"), ({0}, {1, 2}, '0-12'),
({1, 2}, {3}, '1-3'), ({1, 2}, {3}, '2-3'),
({1, 2}, {1, 2}, '1-2'), ({1, 2}, {1, 2}, '2-1')]
}}}
Apply: trac_10874-graph-strongly_connected_componnents-nt.patch
--
Comment(by nthiery):
Oops; I need to recheck my workflow; I forgot this way too many times
lately. Sorry!
While I was at it, I folded the two patches together. No other changes.
trac_10874-reviewer.patch can now be deleted from trac.
Cheers,
Nicolas
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10874#comment:5>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.