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
Refactor min spanning tree #18906
Comments
This comment has been minimized.
This comment has been minimized.
Changed keywords from none to Minimum spanning tree |
Author: Michele Borassi |
Commit: |
New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:6
I like this patch, and I didn't know that it had bugs. Wouldn't it be nicer if edges were sorted (including end-vertices) ? You could use e.g. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Reviewer: David Coudert |
comment:8
Good to go. |
comment:9
Hello! I just realized I need some more modifications on the code to deal with multiple edges, before implementing the Boost version. I will submit the new version as soon as possible! See you, Michele |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:11
Hello! I have made two more changes to the Kruskal algorithm, specified in the description:
Sorry for the "late" decision, but I realized this was better only after I submitted the previous code. Michele |
This comment has been minimized.
This comment has been minimized.
comment:13
There is no need for a new method The best is to improve |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:15
You are right: I removed the method, and I call the
I have improved |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:17
It's much better now. |
Changed branch from u/borassi/refactor_min_spanning_tree to |
Solve some strange behaviors / bugs in minimum spanning tree routines.
Usually, if the graph is weighted, the weight is ignored, and the
weight_function
argument is used. If this argument is not provided, the (rather counterintuitive) behavior is to set all weights to 1 (so that any spanning tree can be outputted). However, if Kruskal algorithm is used, andcheck
is set toTrue
, then edge weights are used, instead.This example also shows that the outputs are different.
Moreover, NetworkX algorithm does not work:
This ticket will change this behavior, by defining a specific order in the choice of weights:
Moreover, it will fix NetworkX problems, and it will standardize the output.
Finally, it will modify Kruskal algorithm as follows:
This is a first step before the inclusion of Boost minimum spanning tree algorithms.
CC: @nathanncohen @dcoudert
Component: graph theory
Keywords: Minimum spanning tree
Author: Michele Borassi
Branch/Commit:
299bc40
Reviewer: David Coudert
Issue created by migration from https://trac.sagemath.org/ticket/18906
The text was updated successfully, but these errors were encountered: