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

random_spanning_tree ignores weights #30566

Closed
pelegm opened this issue Sep 13, 2020 · 17 comments
Closed

random_spanning_tree ignores weights #30566

pelegm opened this issue Sep 13, 2020 · 17 comments

Comments

@pelegm
Copy link
Contributor

pelegm commented Sep 13, 2020

!Aldous/Broder on a weighted graph should perform a random walk on that graph which considers the weights, and this is not the case at the moment.

Options:

  1. make the walk consider the weights
  2. add a warning for weighted graphs

Component: graph theory

Keywords: random_spanning_tree, aldous/broder, weighted_graphs

Author: David Coudert

Branch/Commit: 16816c8

Reviewer: Frédéric Chapoton

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

@pelegm pelegm added this to the sage-9.2 milestone Sep 13, 2020
@pelegm
Copy link
Contributor Author

pelegm commented Sep 13, 2020

comment:1

I don't have a development environment on my computer at the moment, but the difference should be in the following line:

new_s = neighbours[randint(0, len(neighbours) - 1)]

Instead, new_s should be chosen with weights considered (if and only if the graph is weighted). The sage function choice does not support weights, but numpy's choice does:

https://stackoverflow.com/a/26196078/1565828

@mkoeppe mkoeppe modified the milestones: sage-9.2, sage-9.3 Oct 24, 2020
@dcoudert
Copy link
Contributor

Author: David Coudert

@dcoudert
Copy link
Contributor

@dcoudert
Copy link
Contributor

Commit: 67c8cbb

@dcoudert
Copy link
Contributor

comment:3

With this branch, the walk considers the weights.


New commits:

67c8cbbtrac #30566: random spanning tree by weights

@mkoeppe
Copy link
Contributor

mkoeppe commented May 10, 2021

comment:4

Moving to 9.4, as 9.3 has been released.

@mkoeppe mkoeppe modified the milestones: sage-9.3, sage-9.4 May 10, 2021
@mkoeppe
Copy link
Contributor

mkoeppe commented Jul 19, 2021

comment:5

Setting a new milestone for this ticket based on a cursory review.

@mkoeppe mkoeppe modified the milestones: sage-9.4, sage-9.5 Jul 19, 2021
@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 8, 2021

Changed commit from 67c8cbb to d410caa

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 8, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

1256172trac #30566: merged with 9.5.beta5
d410caatrac #30566: cleaner use of weights

@dcoudert
Copy link
Contributor

dcoudert commented Nov 8, 2021

comment:7

Clean the use of weights as part of #13112

@fchapoton
Copy link
Contributor

comment:8

ca me parait bien. Peut-etre ajouter un doctest que le resultat est bien un arbre lorsqu'on utilise les poids ?

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 9, 2021

Changed commit from d410caa to 16816c8

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 9, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

16816c8trac #30566: check that the output is a tree

@dcoudert
Copy link
Contributor

dcoudert commented Nov 9, 2021

comment:10

Tu as raison.

@fchapoton
Copy link
Contributor

Reviewer: Frédéric Chapoton

@fchapoton
Copy link
Contributor

comment:11

ok, positif

@vbraun
Copy link
Member

vbraun commented Nov 14, 2021

Changed branch from public/graphs/30566_random_spanning_tree to 16816c8

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

5 participants