COIN-OR::LEMON - Graph Library

Changeset 1522:321661278137 in lemon-0.x for doc/graph_io.dox


Ignore:
Timestamp:
06/28/05 19:46:35 (15 years ago)
Author:
athos
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2008
Message:

Some corrections to graph_io.dox (mainly language corrections). Improvements on quicktour.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/graph_io.dox

    r1394 r1522  
    55\page graph-io-page Graph Input-Output
    66
    7 The standard graph IO makes possible to store graphs and additional maps
     7The standard graph IO enables to store graphs and additional maps
    88in a flexible and efficient way.
    99
    1010\section format The general file format
    1111
    12 The graph file contains at most four section in the next order:
     12The file contains at most four sections in the following order:
    1313
    1414\li nodeset
     
    1717\li edges
    1818
    19 The nodeset section starts with the \c \@nodeset line.
    20 The next line contains the names of the maps separated by whitespaces.
    21 Each following line describes a node in the graph, it contains
    22 in the right order the values of the maps. The map named "id" should contain
    23 unique values because it regarded as ID-map.
     19The nodeset section starts with the following line:
     20
     21<tt>\@nodeset</tt>
     22
     23The next line contains the names of the nodemaps, separated by whitespaces.  Each
     24following line describes a node in the graph: it contains the values of the
     25maps in the right order. The map named "id" should contain unique values
     26because it is regarded as an ID-map. For example:
    2427
    2528\code
     
    3235
    3336The edgeset section is very similar to the nodeset section, it has
    34 same coloumn oriented structure. It starts with the line \c \@edgeset
    35 The next line contains the whitespace separated list of names of the map.
     37the same coloumn oriented structure. It starts with the line
     38
     39<tt>\@edgeset</tt>
     40
     41The next line contains the whitespace separated list of names of the maps.
    3642Each of the next lines describes one edge. The first two elements in the line
    37 are the ID of the source and target node as they occur in the ID node map.
     43are the IDs of the source and target (or tail and head) node of the edge as they occur in the ID node
     44map. You can also have an optional ID map on the edges for later reference.
    3845
    3946\code
     
    4754The next section contains <em>labeled nodes</em> (i.e. nodes having a special
    4855label on them). The section starts with
    49 \c \@nodes. Each of the next lines contains a label for a node in the graph
    50 and then the ID described in the nodeset.
     56
     57<tt> \@nodes </tt>
     58
     59Each of the next lines contains a label for a node in the graph
     60and then the ID described in the nodeset section.
    5161
    5262\code
     
    6575\endcode
    6676
    67 The file ends with the \c \@end line.
    6877
    6978The file may contain empty lines and comment lines. The comment lines
    7079start with an \c # character.
    7180
    72 \code
    73 @end
    74 \endcode
     81The file ends with the
     82
     83<tt> \@end </tt>
     84
     85line.
     86
    7587
    7688\section use Using graph input-output
    77 The graph input and output based on writing and reading commands. The user
    78 adds writing and reading commands for the reader or writer class, then
     89The graph input and output is based on reading and writing commands. The user
     90adds reading and writing commands to the reader or writer class, then he
    7991calls the \c run() method that executes all the given commands.
    8092
     
    91103
    92104The \c writeNodeMap() function declares a \c NodeMap writing command in the
    93 \c GraphWriter. You should give as parameter the name of the map and the map
    94 object. The NodeMap writing command with name "id" should write a
     105\c GraphWriter. You should give a name of the map and the map
     106object as parameters. The NodeMap writing command with name "id" should write a
    95107unique map because it is regarded as ID map.
    96108
     
    110122
    111123\see IdMap, DescriptorMap 
     124
    112125\code
    113126DescriptorMap<ListGraph, Edge, ListGraph::EdgeMap<int> > edgeDescMap(graph);
     
    118131\endcode
    119132
    120 With \c writeNode() and \c writeEdge() functions you can point out Nodes and
    121 Edges in the graph. By example, you can write out the source and target
    122 of the graph.
     133With \c writeNode() and \c writeEdge() functions you can designate Nodes and
     134Edges in the graph. For example, you can write out the source and target node
     135of a maximum flow instance.
    123136
    124137\code
     
    130143
    131144After you give all write commands you must call the \c run() member
    132 function, which execute all the writer commands.
     145function, which executes all the writing commands.
    133146
    134147\code
     
    141154If you read a graph you need not read all the maps and items just those
    142155that you need. The interface of the \c GraphReader is very similar to
    143 the GraphWriter but the reading method does not depend on the order the
     156the GraphWriter but the reading method does not depend on the order of the
    144157given commands.
    145158
    146 The reader object suppose that each not readed value does not contain
     159The reader object assumes that each not readed value does not contain
    147160whitespaces, therefore it has some extra possibilities to control how
    148161it should skip the values when the string representation contains spaces.
     
    153166
    154167The \c readNodeMap() function reads a map from the \c \@nodeset section.
    155 If there is a map that you do not want to read from the file and there is
    156 whitespace in the string represenation of the values then you should
     168If there is a map that you do not want to read from the file and there are
     169whitespaces in the string represenation of the values then you should
    157170call the \c skipNodeMap() template member function with proper parameters.
    158171
    159172\see QuotedStringReader
     173
    160174\code
    161175reader.readNodeMap("x-coord", xCoordMap);
     
    187201
    188202After you give all read commands you must call the \c run() member
    189 function, which execute all the commands.
     203function, which executes all the commands.
    190204
    191205\code
     
    193207\endcode
    194208
    195 \section types The background of the Reading and Writing
    196 The \c GraphReader should know how can read a Value from the given map.
     209\section types The background of Reading and Writing
     210The \c GraphReader should know how to read a Value from the given map.
    197211By the default implementation the input operator reads a value from
    198212the stream and the type of the readed value is the value type of the given map.
Note: See TracChangeset for help on using the changeset viewer.