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:

"destinationIP": "",
"lastHopIP": "",
"linkQuality": 1.000,
"neighborLinkQuality": 1.000,
"tcEdgeCost": 1024,
"validityTime": 272215

The interpretation of this json is:
  1. destinationIP is one end of the link
  2. lastHopIp is the other end
  3. the cost of the link is given by tcEdgeCost (which in most cases should be 1024/(linkQuality*neighborLinkQuality))

ninux_30_1.edges (1.63 KB) Leonardo Maccari, 10/30/2015 01:00 PM

jsoninfo_topo.json (32.6 KB) Leonardo Maccari, 10/30/2015 01:03 PM

olsr-netjson.json (5.68 KB) Leonardo Maccari, 10/30/2015 01:03 PM