There are three formats for graphs I whish to support. The first is very easy, it is an edgefile, which means a textfile in the format:
source destination cost
where each line represents a link from source to destination (in our case links are bidirectional) and the cost is the weight of the link to be used for shortest path computation.
Here you have a sample: ninux_30_1.edges. I would not be surprised if boost::graph already has a parser for that. You can start with this to make some tests.
The other two formats are json-based. This is called netjson: olsr-netjson.json it's pretty straightforward and documented here:
avoid importing any information that is not the node-id, the links and the cost.
A third format is another JSON produced directly from the OLSRd daemon: jsoninfo_topo.json. This format contains a lot of information you don't really need, the only information you need is the "topology" array, in which, for each link there is an entry and two weights, in the form:
The interpretation of this json is:
- destinationIP is one end of the link
- lastHopIp is the other end
- the cost of the link is given by tcEdgeCost (which in most cases should be 1024/(linkQuality*neighborLinkQuality))