On Wed, 18 Oct 2017, David Coudert wrote:
But anyways, I found more. is_eulerian(path=True) will return either
False OR an Eulerian path. This seems to be clearly wrong.
It is not a correct behavior. This method should have a parameter
`certificate`, default to False. When certificate is True, it returns a
pair boolean and certificate (see e.g., is_tree).
Sounds reasonable. But then what to do to eulerian_circuit()? There could
be a function to count or list eulerian circuits too (a problem in #P,
says Wikipedia).
What's more, is_eulerian(path=True) returns True when the graph has an
Eulerian path BUT has not Eulerian cycle. Is this normal use in graph
theory?
This is not consistent with the definition: “a graph has an Eulerian
path if and only if exactly zero or two vertices have odd degree".
True. But it is useful function to have shorcut for
"g.has_eulerian_path() and not g.has_eulerian_circuit()"?
* * *
I think we have a clear consensus on two things: 1) is_* -function shall
return either a Boolean or a pair where first element is a Boolean, and as
I said before, 2) function related to Hamiltonian path/cycle shall be
similar to those related to Eulerian path/cycle.
--
Jori Mäntysalo