Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Steiner Tree #8403

Closed
nathanncohen mannequin opened this issue Feb 28, 2010 · 13 comments
Closed

Steiner Tree #8403

nathanncohen mannequin opened this issue Feb 28, 2010 · 13 comments

Comments

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Feb 28, 2010

Here is a patch containing the function Graph.steiner_tree.

It consists in finding in a graph, given a set S of vertices, a tree in G of minimum weight/cardinality containing the vertices from S.

Everything is explained in the docstrings anyway :-)

Nathann

CC: @jasongrout

Component: graph theory

Author: Nathann Cohen

Reviewer: Robert Miller

Merged: sage-4.5.alpha1

Issue created by migration from https://trac.sagemath.org/ticket/8403

@nathanncohen nathanncohen mannequin added this to the sage-4.5 milestone Feb 28, 2010
@nathanncohen nathanncohen mannequin assigned rlmill Feb 28, 2010
@nathanncohen nathanncohen mannequin added the s: needs review label Feb 28, 2010
@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Apr 8, 2010

comment:2

For an explanation of the Linear Program used to solve this problem, see the LP chapter from : http://code.google.com/p/graph-theory-algorithms-book/

Nathann

@rlmill
Copy link
Mannequin

rlmill mannequin commented Jun 17, 2010

comment:4

I don't think that, as you claim, minimum spanning trees can be computed in linear time.

@rlmill rlmill mannequin added s: needs work and removed s: needs review labels Jun 17, 2010
@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Jun 18, 2010

comment:5

And you are right. I was thinking about spanning trees, as I usually do not care about weights, but min spanning trees require a bit longer. nlog(n) is enough , even if better can be achieved, by first sorting the edges according to their weights, then greedily building a spanning tree..

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Jun 18, 2010

comment:6

Here it is !

Nathann

@rlmill
Copy link
Mannequin

rlmill mannequin commented Jun 18, 2010

comment:7

Attachment: trac_8403.patch.gz

Replying to @nathanncohen:

And you are right. I was thinking about spanning trees, as I usually do not care about weights...

I don't think spanning tree is linear: the standard method is a BFS/DFS, which is still worst case quadratic. I know this is no longer relevant here, but I want to make sure I have this right. If you do know of a linear time spanning tree algorithm, I'm curious about it.

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Jun 18, 2010

comment:8

That's what I call linear -- not according to the the number of vertices, but according to the size of the input : n+m :-)

Nathann

@rlmill
Copy link
Mannequin

rlmill mannequin commented Jun 19, 2010

Author: Nathann Cohen

@rlmill
Copy link
Mannequin

rlmill mannequin commented Jun 19, 2010

Reviewer: Robert Miller

@rlmill
Copy link
Mannequin

rlmill mannequin commented Jun 19, 2010

comment:9

Replying to @nathanncohen:

That's what I call linear -- not according to the the number of vertices, but according to the size of the input : n+m :-)

Aha, thanks for clarifying. If you approve of my part2, set the ticket to positive-- all looks good to me!

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Jun 20, 2010

comment:10

Attachment: trac_8403-part2.patch.gz

Thank you again ! :-)

Nathann

@rlmill
Copy link
Mannequin

rlmill mannequin commented Jun 28, 2010

apply before part 2

@rlmill
Copy link
Mannequin

rlmill mannequin commented Jun 29, 2010

comment:11

Attachment: trac_8403-rebased.patch.gz

@rlmill
Copy link
Mannequin

rlmill mannequin commented Jun 29, 2010

Merged: sage-4.5.alpha1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

0 participants