COIN-OR::LEMON - Graph Library

Changeset 1901:723b2b81d900 in lemon-0.x for doc/graph_io.dox


Ignore:
Timestamp:
01/24/06 17:07:38 (18 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2476
Message:

Lemon Graph Format uses label instead of id named map.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/graph_io.dox

    r1848 r1901  
    3232The next line contains the names of the nodemaps, separated by whitespaces.  Each
    3333following line describes a node in the graph: it contains the values of the
    34 maps in the right order. The map named "id" should contain unique values
    35 because it is regarded as an ID-map. These ids need not be numbers but they
     34maps in the right order. The map named "label" should contain unique values
     35because it is regarded as a label map. These labels need not be numbers but they
    3636must identify the nodes uniquely for later reference. For example:
    3737
    3838\code
    3939@nodeset
    40 id  x-coord  y-coord  color
     40label  x-coord  y-coord  color
    41413   1.0      4.0      blue
    42425   2.3      5.7      red
     
    5151The next line contains the whitespace separated list of names of the edge
    5252maps.  Each of the next lines describes one edge. The first two elements in
    53 the line are the IDs of the source and target (or tail and head) nodes of the
    54 edge as they occur in the ID node map of the nodeset section. You can also
    55 have an optional ID map on the edges for later reference (which has to be
     53the line are the labels of the source and target (or tail and head) nodes of the
     54edge as they occur in the label node map of the nodeset section. You can also
     55have an optional label map on the edges for later reference (which has to be
    5656unique in this case).
    5757
    5858\code
    5959@edgeset
    60              id    weight   label
    61 3   5        a     4.3      a-edge
    62 5   12       c     2.6      c-edge
    63 3   12       g     3.4      g-edge
     60             label      weight   note
     613   5        a          4.3      a-edge
     625   12       c          2.6      c-edge
     633   12       g          3.4      g-edge
    6464\endcode
    6565
     
    7171
    7272Each of the next lines contains a label for a node in the graph
    73 and then the ID as described in the \e nodeset section.
     73and then the label as described in the \e nodeset section.
    7474
    7575\code
     
    8181The last section describes the <em>labeled (distinguished) edges</em>
    8282(i.e. edges having a special label on them). It starts with \c \@edges
    83 and then each line contains the name of the edge and the ID.
     83and then each line contains the name of the edge and the label.
    8484
    8585\code
     
    104104\endcode
    105105
    106 <tt> \@end </tt>
    107 
    108 line.
     106Finally, the file should be closed with \c \@end line.
    109107
    110108
     
    133131\ref lemon::GraphWriter "GraphWriter".
    134132You should give a name to the map and the map
    135 object as parameters. The NodeMap writing command with name "id" should write a
    136 unique map because it will be regarded as an ID map.
     133object as parameters. The NodeMap writing command with name "label" should write a
     134unique map because it will be regarded as a label map.
    137135
    138136\see IdMap, DescriptorMap 
    139137
    140138\code
    141 IdMap<ListGraph, Node> nodeIdMap;
    142 writer.writeNodeMap("id", nodeIdMap);
     139IdMap<ListGraph, Node> nodeLabelMap;
     140writer.writeNodeMap("label", nodeLabelMap);
    143141
    144142writer.writeNodeMap("x-coord", xCoordMap);
     
    158156
    159157writer.writeEdgeMap("weight", weightMap);
    160 writer.writeEdgeMap("label", labelMap);
     158writer.writeEdgeMap("note", noteMap);
    161159\endcode
    162160
     
    315313special template parameter to the GraphReader class. By default, the
    316314template parameter is \c DefaultReaderTraits. A reader traits class
    317 should provide an inner template class Reader for each type, and a
     315should provide a nested template class Reader for each type, and a
    318316DefaultReader for skipping a value.
    319317
    320 The specialization of  writing is very similar to that of reading.
     318The specialization of writing is very similar to that of reading.
    321319
    322320\section undir Undirected graphs
     
    334332\code
    335333@undiredgeset
    336              id    capacity +flow -flow
    337 32   2       1     4.3      2.0   0.0
    338 21   21      5     2.6      0.0   2.6
    339 21   12      8     3.4      0.0   0.0
     334             label      capacity        +flow  -flow
     33532   2       1          4.3             2.0     0.0
     33621   21      5          2.6             0.0     2.6
     33721   12      8          3.4             0.0     0.0
    340338\endcode
    341339
     
    462460and the \ref lemon::UndirGraphReader "UndirGraphReader" can be converted
    463461to \ref lemon::LemonReader "LemonReader"
    464 and it can resolve the ID's of the items, the previous
     462and it can resolve the label's of the items, the previous
    465463result can be achived with the \ref lemon::UndirGraphReader "UndirGraphReader"
    466464class, too.
Note: See TracChangeset for help on using the changeset viewer.