Question on the last page of the primer : Parser optimization
Hello,
I am currently writing a graph converter that outputs a gexf file (which is a very neat graph format comparing to others like GraphML or TLP) so I read the Primer and managed to do a pretty decent converter but I didn't get one of the bullets on the last page. So here is my question :
You talk about a count attribute that I used on <nodes> and <edges> to specify the number of edges and nodes of my graph, but then I read the phrase "Note that count only refers to direct children, not the whole sub-graph!". I don't understand what you mean by that (and none of the example files uses that attribute), can you explain it or show an example ?
Regards.
Daniel
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- GEXF Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Sébastien Heymann
- Solved:
- 2010-08-11
- Last query:
- 2010-08-11
- Last reply:
- 2010-08-11
Hi Daniel,
Thank you for the compliment. This is an example:
In a given hierarchical network, imagine you have 3 levels of hierarchy: level A includes level B includes level C.
One node in level A contains 3 nodes at level B. Each one of them contains 2 nodes at level C.
So you only count the nodes existing at the direct sub-level:
<nodes count="1"> //level A
<node>
<nodes count="3"> //level B
<node>
<nodes count="2"> //level C
<node />
<node />
</nodes>
</node>
<node>
<nodes count="2"> //level C
<node />
<node />
</nodes>
</node>
<node>
<nodes count="2"> //level C
<node />
<node />
</nodes>
</node>
</nodes>
</node>
</nodes>
Does it more clear?
Daniel Ristic (daniel-ristic) said : | #2 |
Thanks for the quick answer !
That's now perfectly clear.
Daniel Ristic (daniel-ristic) said : | #3 |
Thanks Sébastien Heymann, that solved my question.