#18864: New method for the eccentricity of undirected graphs
-------------------------+-------------------------------------------------
Reporter: | Owner:
dcoudert | Status: needs_review
Type: | Milestone: sage-6.8
enhancement | Resolution:
Priority: minor | Merged in:
Component: graph | Reviewers:
theory | Work issues:
Keywords: | Commit:
Authors: David | a3717b73c811ff702345a186b679df4b99e725fa
Coudert | Stopgaps:
Report Upstream: N/A |
Branch: |
public/18864 |
Dependencies: |
-------------------------+-------------------------------------------------
Old description:
> This patch implements the algorithm proposed in [1] for computing the
> eccentricity of all vertices. It can be faster than the standard
> algorithm.
>
> {{{
> sage: from sage.graphs.distances_all_pairs import eccentricity
> sage: G = graphs.PetersenGraph()
> sage: %time _= eccentricity(G, method='standard')
> CPU times: user 299 µs, sys: 75 µs, total: 374 µs
> Wall time: 361 µs
> sage: %time _= eccentricity(G, method='bounds')
> CPU times: user 218 µs, sys: 29 µs, total: 247 µs
> Wall time: 235 µs
> sage: G = graphs.RandomBarabasiAlbert(10000,2)
> sage: %time _= eccentricity(G, method='standard')
> CPU times: user 2.78 s, sys: 7.8 ms, total: 2.78 s
> Wall time: 2.79 s
> sage: %time _= eccentricity(G, method='bounds')
> CPU times: user 1.66 s, sys: 8.06 ms, total: 1.67 s
> Wall time: 1.67 s
> }}}
>
> [1] F. W. Takes and W. A. Kosters. Computing the eccentricity
> distribution of large graphs. *Algorithms* 6:100-118 (2013)
> http://dx.doi.org/10.3390/a6010100
New description:
This patch implements the algorithm proposed in [1] for computing the
eccentricity of all vertices of a connected undirected unweighted graph.
It can be faster than the standard algorithm.
{{{
sage: from sage.graphs.distances_all_pairs import eccentricity
sage: G = graphs.PetersenGraph()
sage: %time _= eccentricity(G, method='standard')
CPU times: user 299 µs, sys: 75 µs, total: 374 µs
Wall time: 361 µs
sage: %time _= eccentricity(G, method='bounds')
CPU times: user 218 µs, sys: 29 µs, total: 247 µs
Wall time: 235 µs
sage: G = graphs.RandomBarabasiAlbert(10000,2)
sage: %time _= eccentricity(G, method='standard')
CPU times: user 2.78 s, sys: 7.8 ms, total: 2.78 s
Wall time: 2.79 s
sage: %time _= eccentricity(G, method='bounds')
CPU times: user 1.66 s, sys: 8.06 ms, total: 1.67 s
Wall time: 1.67 s
}}}
Similar method for directed graphs and weighted (di)graphs can be the
object of future tickets.
----
[1] F. W. Takes and W. A. Kosters. Computing the eccentricity distribution
of large graphs. *Algorithms* 6:100-118 (2013)
http://dx.doi.org/10.3390/a6010100
--
Comment (by dcoudert):
I have implemented requested changes.
However, I propose to restrict this patch to undirected graph and to
consider directed graphs in another ticket.
Best,
David.
--
Ticket URL: <http://trac.sagemath.org/ticket/18864#comment:18>
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.