#13289: Determine if a vertex is a cut vertex
---------------------------------+------------------------------------------
Reporter: dcoudert | Owner: jason, ncohen, rlm
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-5.3
Component: graph theory | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: David Coudert | Merged in:
Dependencies: | Stopgaps:
---------------------------------+------------------------------------------
Changes (by dcoudert):
* status: needs_work => needs_review
Comment:
I fact, only one DFS is required for undirected graphs (or weak
connectivity), and two for the strong connectivity of directed graphs. I
don't need to copy the graph anymore and the running time of the resulting
algorithm is acceptable.
{{{
sage: G = digraphs.RandomDirectedGNP(1000,.3)
sage: H = digraphs.RandomDirectedGNP(1000,.3)
sage: K = G+H
sage: K.add_edge(0,1000)
sage: K.add_edge(1200,300)
sage: %time K.is_strongly_connected()
CPU times: user 0.09 s, sys: 0.00 s, total: 0.09 s
Wall time: 0.09 s
True
sage: %time K.is_cut_vertex(0)
CPU times: user 0.23 s, sys: 0.00 s, total: 0.23 s
Wall time: 0.23 s
True
sage: %time K.is_cut_vertex(0, weak=True)
CPU times: user 1.01 s, sys: 0.00 s, total: 1.01 s
Wall time: 1.01 s
False
}}}
The only way to be faster is to use cython, as for the
is_strongly_connected function. But I'm not sure it is worth the effort.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13289#comment:14>
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.