Defining a xml for representing adjacency list of graphs?

AloneBoss

New Member
I am working on a python graph library and I am using adjacency list. I am thinking about using xml to represent the adjacency list so it will be easier for me to store to or read from graphs.For a graph like this:\[code\] A |\ | \ | \ B---C\[/code\]the adjacency will look likeA:[B,C]B:[A,C]C:[A,B]The question comes here, how will you convert it into xml? I have a (very) limited xml knowledge so mine looks like:\[code\]<graph> <node> A <realtedto>[B,C]</relatedto> </node> ...</graph>\[/code\]Does this look right to you? And also, how will you deal with the issue that the graph may be not simple or directional?
 
Back
Top