sagemath/sage

Fix random tree on one or less vertices

Closed this issue · 10 comments

kliem commented
sage: graphs.RandomTree(1)
...
TypeError: unhashable type: 'list'

CC: @hivert @slel

Component: graph theory

Keywords: random tree

Author: Jonathan Kliem

Branch/Commit: b736c96

Reviewer: David Coudert

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

kliem commented

New commits:

a732a3ffix random tree on less than two vertices
kliem commented

Commit: a732a3f

kliem commented

Branch: public/32108

comment:3

It might be better to do

- g = Graph()
+ g = Graph(n)
+ if n < 2:
+     return g

and then remove the line

- g.add_vertices(range(n))

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

b736c96more natural treating of small cases for random tree

Changed commit from a732a3f to b736c96

comment:5

LGTM.

Reviewer: David Coudert

kliem commented
comment:6

Thank you.

Changed branch from public/32108 to b736c96