Problem with simple graph on windows 7

Hi,

I'm trying to display the following graph:

graph G {
0[4];
1[9];
2[3];
3[8];
4[2];
5[7];
6[6];
7[1];
8[5];
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,

Brammert

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 http://www.graphviz.org/Gallery.php. 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.

 

Thanks

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

Hi,

 

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