Problem with simple graph on windows 7


I'm trying to display the following graph:

graph G {
3--1 [];
6--5 [];
2--1 [];
2--3 [];
7--8 [];
0--8 [];
7--6 [];
5--4 [];
7--4 [];
7--0 [];

but I get the following error in the console:

Warning: :2: syntax error in line 2 near ']'

It must be a very simple thing that must be missing, but I can't seem to find it. In older verstions of graphviz I didn't have any problems displaying this graph. Hope anyone can help,


I can't recall graphviz ever

I can't recall graphviz ever accepting the syntax 0[4] for nodes. This declares a node named "0" but what does the 4 mean? Attribute lists supplied with [...] must always be name/value pairs, so the following would be legal:

0 [label=4]

You can also find sample graphs at If you click on a graph, you can then see its source.

It does work for earlier versione

If I give the exact same format, exact same file, to previous versions it does display the graph properly. But I'll have a look at the examples.



You are correct. We switched

You are correct. We switched to a new parser in 2.30 and it is a bit stricter than the old parser. The question is still, what should 0[4] mean? This basically got interpreted as 0[4=true], which has no effect. In general, the intention is for attributes to be lists of name=value pairs.

That explains



the stricter parser explains the problem then. To answer your other question 0[4] should mean 0[label = 4].So I'll just change it and that should solve my problem :)

Recent comments