#13239: Contraction of edges in a graph.
------------------------------------------------+---------------------------
Reporter: lkeough | Owner: jason,
ncohen, rlm
Type: enhancement | Status: needs_info
Priority: major | Milestone: sage-5.3
Component: graph theory | Resolution:
Keywords: SD40 | Work issues:
Report Upstream: N/A | Reviewers: Marshall
Hampton, David Coudert
Authors: Lauren Keough, Jeremy Martin | Merged in:
Dependencies: | Stopgaps:
------------------------------------------------+---------------------------
Changes (by dcoudert):
* cc: dcoudert (added)
* reviewer: Marshall Hampton => Marshall Hampton, David Coudert
* status: positive_review => needs_info
Comment:
Hello,
I don't understand this new patch. If the behavior of the contract_edge
function proposed in patch #7304 is not adapted to your purpose, you could
add extra parameters (inplace = False, keep_multiedges, etc.)
Furthermore, it works only for undirected graphs. So it should at least be
in graph.py and not in generic_graph.py.
In the following example, arc (3,0) becomes arc (0,3)
{{{
sage: D = digraphs.RandomDirectedGNP(5,.5)
sage: h = D.contraction((0,1))
sage: D.edges(labels=None)
[(0, 1), (0, 2), (0, 3), (1, 0), (1, 3), (1, 4), (2, 0), (3, 0), (3, 1),
(3, 4), (4, 2)]
sage: h.edges(labels=None)
[(0, 0), (0, 2), (0, 2), (0, 3), (0, 3), (0, 3), (0, 3), (0, 4), (2, 4),
(3, 4)]
}}}
D.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13239#comment:4>
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.