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

spanning_trees does not enumerate spanning trees with edge labels #27557

Closed
rajat1433 mannequin opened this issue Mar 27, 2019 · 14 comments
Closed

spanning_trees does not enumerate spanning trees with edge labels #27557

rajat1433 mannequin opened this issue Mar 27, 2019 · 14 comments

Comments

@rajat1433
Copy link
Mannequin

rajat1433 mannequin commented Mar 27, 2019

Currently spanning_trees() method does not enumerate spanning trees with their labels , it makes their labels None. This tickets aims to return the correct labels of the edges.

CC: @dcoudert

Component: graph theory

Keywords: enumeration, spanning_trees

Author: Rajat Mittal

Branch/Commit: 957df83

Reviewer: David Coudert

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

@rajat1433 rajat1433 mannequin added this to the sage-8.8 milestone Mar 27, 2019
@rajat1433
Copy link
Mannequin Author

rajat1433 mannequin commented Mar 27, 2019

Branch: u/gh-rajat1433/27557_spanning_trees

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 27, 2019

Commit: 7d295fa

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 27, 2019

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

7d295falabels include

@rajat1433
Copy link
Mannequin Author

rajat1433 mannequin commented Mar 27, 2019

comment:3

I have modified the code to include labels and tested on a few examples.

@rajat1433 rajat1433 mannequin added the s: needs review label Mar 27, 2019
@dcoudert
Copy link
Contributor

comment:4

You should add parameter labels=False to the method so that user get edge labels only when specifically asked for.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 27, 2019

Changed commit from 7d295fa to 2c9f53c

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 27, 2019

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

2c9f53cadded labels option

@rajat1433
Copy link
Mannequin Author

rajat1433 mannequin commented Mar 27, 2019

comment:6

added labels=False option

@dcoudert
Copy link
Contributor

comment:7

2 remarks:

  • the text for the doctest could provide more information like Edges of the spanning trees can be labeled or unlabeled (:trac:27557)::

  • when calling _recursive_.., you don't need to write labels=labels.

-            return _recursive_spanning_trees(Graph(self, immutable=False, loops=False), forest, labels=labels)
+            return _recursive_spanning_trees(Graph(self, immutable=False, loops=False), forest, labels)

It would be nice to also get spanning_tree_iterator(). May be for another ticket.

@rajat1433
Copy link
Mannequin Author

rajat1433 mannequin commented Mar 27, 2019

comment:8

Yes I have opened another ticket in which spanning_tree_iterator needs to be implemented in increasing order of weights. ticket:27532 Hope that gets implemented soon.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 27, 2019

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

957df83updated

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 27, 2019

Changed commit from 2c9f53c to 957df83

@dcoudert
Copy link
Contributor

comment:10

LGTM

@vbraun
Copy link
Member

vbraun commented Mar 30, 2019

Changed branch from u/gh-rajat1433/27557_spanning_trees to 957df83

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

2 participants