MassimoLauria / cnfgen

CNF generator in DIMACS format. It produces common families of CNFs.
GNU General Public License v3.0
63 stars 15 forks source link

Warn about directed undirected graphs #78

Open jakobnordstrom opened 7 years ago

jakobnordstrom commented 7 years ago

I think it would be a very nice and helpful feature of CNFgen if, when the program is expecting an undirected (non-bipartite) graph but gets a directed one, it would issue a gentle warning about this.

It might still be natural to use the semantics that if v is mentioned as a neighbour of u, then (u, v) is an undirected edge, and to generate whatever the formula is. But as a graph generator programmer I know that I want also to have u mentioned in the neighbour list of v in this case, and if I screwed up then it would be extremely helpful to have someone alert me to this.

jakobnordstrom commented 7 years ago

Just to add that when parsing graphs with CNFgen it would be nice to have a -strict option for which I can get a warning if 1,2,3,... is not a valid topological ordering.

A similar -strict option would also warn if the graph is not undirected when an undirected graph is expected.