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

digraphs.Tournament(1) has 0 vertices #14653

Closed
sagetrac-rowland mannequin opened this issue May 28, 2013 · 7 comments
Closed

digraphs.Tournament(1) has 0 vertices #14653

sagetrac-rowland mannequin opened this issue May 28, 2013 · 7 comments

Comments

@sagetrac-rowland
Copy link
Mannequin

sagetrac-rowland mannequin commented May 28, 2013

sage: digraphs.Tournament(1)
Tournament on 1 vertices: Digraph on 0 vertices
sage: digraphs.Tournament(1).vertices()
[]

Causes the following.

sage: digraphs.Tournament(3) + digraphs.Tournament(1)
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-50-0b88bd757fb1> in <module>()
----> 1 digraphs.Tournament(Integer(3)) + digraphs.Tournament(Integer(1))

/Applications/sage/local/lib/python2.7/site-packages/sage/graphs/generic_graph.pyc in __add__(self, other_graph)
    363         """
    364         if isinstance(other_graph, GenericGraph):
--> 365             return self.disjoint_union(other_graph, verbose_relabel=False)
    366 
    367     def __eq__(self, other):

/Applications/sage/local/lib/python2.7/site-packages/sage/graphs/generic_graph.pyc in disjoint_union(self, other, verbose_relabel)
  13289             for v in other:
  13290                 r_other[v] = i; i += 1
> 13291             G = self.relabel(r_self, inplace=False).union(other.relabel(r_other, inplace=False))
  13292         elif any(u==v for u in self for v in other):
  13293             r_self = dict([[v,(0,v)] for v in self])

/Applications/sage/local/lib/python2.7/site-packages/sage/graphs/generic_graph.pyc in relabel(self, perm, inplace, return_map, check_input, complete_partial_function)
  16024                               return_map= return_map,
  16025                               check_input = check_input,
> 16026                               complete_partial_function = complete_partial_function)
  16027 
  16028             if return_map:

/Applications/sage/local/lib/python2.7/site-packages/sage/graphs/generic_graph.pyc in relabel(self, perm, inplace, return_map, check_input, complete_partial_function)
  16096                 new_attr = {}
  16097                 for v,value in getattr(self, attr).iteritems():
> 16098                     new_attr[perm[v]] = value
  16099 
  16100                 setattr(self, attr, new_attr)

KeyError: 0

Found while implementing #14099

Depends on #14536

CC: @nathanncohen

Component: graph theory

Keywords: days47.5

Reviewer: Frédéric Chapoton

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

@sagetrac-rowland sagetrac-rowland mannequin added this to the sage-5.10 milestone May 28, 2013
@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented May 28, 2013

comment:1

What about fixing this as a review of #14536 ? It renames the Tournament method :-)

Nathann

@sagetrac-rowland
Copy link
Mannequin Author

sagetrac-rowland mannequin commented May 29, 2013

comment:2

But renaming it won't fix the errors in

sage: digraphs.Tournament(3) + digraphs.Tournament(1)

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented May 29, 2013

comment:3

Indeed.

I had forgotten thant #14653 had been reviewed already. Well, then you can fix it by replacing DiGraph() by DiGraph(n) in the source code of the new TransitiveTournament method, formerly known at Tournament :-)

Nathann

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented May 29, 2013

Dependencies: #14536

@fchapoton
Copy link
Contributor

comment:4

Well, this has been solved in #14536. I think therefore this ticket can be closed.

@fchapoton
Copy link
Contributor

Reviewer: Frédéric Chapoton

@fchapoton fchapoton removed this from the sage-5.10 milestone May 31, 2013
@fchapoton
Copy link
Contributor

comment:5

confirm that the issue is solved in 5.10.rc1, positive review

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

3 participants