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
is_chordal can raise TypeError #10899
Comments
comment:4
OK, this was quite easy -- the problem was that lex_BFS fails to generate correct tree. If we consider Graph(1), lex_BFS correctly computes order [1], but as a tree it return empty DiGraph, where it sould return DiGraph(1). Then is_chordal fails, because it asks for order of the vertex 1, that is not in the DiGraph. It is somehow unfortunate that out_degree function couldn't detect this problem and respond with a more apropriate error message. So, why does lex_BFS fail to construct the proper tree? It takes the proper edges and adds them to the empty DiGraph. But that is not sufficient when the tree shouldn't contain any edges, as it is in the case of Graph(1). So the whole patch I wrote consist of single line, that adds vertices to the newly created tree too. I tried to run the crash test code from the ticket description and it didn't find any failing case.
|
Attachment: trac_10899_lex_BFS_repair.patch.gz |
comment:5
all doctests pass on top of 4.8.alpha6 on a 64-bit machine. Paul |
Changed keywords from none to sd35.5 |
Attachment: trac_10899_lex_BFS_repair.2.patch.gz |
comment:6
Great! The new version differs only in technical details of the documentation. |
comment:7
please could you add also as doctest the example from the description?
Note: one could wonder whether
Note 2: while reviewing that ticket I discovered that the syntax Paul |
Work Issues: add exemple from description |
comment:8
the issue about undocumented Paul |
comment:9
Attachment: trac_10899_lex_BFS_repair.3.patch.gz I added the requested doctest and a small part of the presented testing program. |
comment:10
English is not my first language, so I'm not sure whether "graph on 0 vertices" sounds weird. Wikipedia says: "Languages having only a singular and plural form may still differ in their treatment of zero. For example, in English, German, Dutch, Italian, Spanish and Portuguese, the plural form is used for zero or more than one, and the singular for one thing only. By contrast, in French, the singular form is used for zero." I guess that some very polite piece of software could write something like "Digraph on no vertices". :-) |
comment:11
thank you, great work! Paul |
This comment has been minimized.
This comment has been minimized.
Author: Lukáš Lánský |
Changed work issues from add exemple from description to none |
Reviewer: Paul Zimmermann |
comment:12
Replying to @sagetrac-brunellus:
"0 vertices" is the correct English. |
Merged: sage-5.0.beta2 |
is_chordal often -- but not always -- raises a TypeError on disconnected graphs (and the one-vertex graph) in 4.6.2:
See trac #8284. The above also causes problems for is_interval, which at one point tries "if not self.is_chordal()".
Apply attachment: trac_10899_lex_BFS_repair.3.patch to the Sage library.
CC: @gvol @sagetrac-brunellus @jasongrout
Component: graph theory
Keywords: sd35.5
Author: Lukáš Lánský
Reviewer: Paul Zimmermann
Merged: sage-5.0.beta2
Issue created by migration from https://trac.sagemath.org/ticket/10899
The text was updated successfully, but these errors were encountered: