alpar@156: /* -*- C++ -*-
alpar@156:  *
alpar@156:  * This file is a part of LEMON, a generic C++ optimization library
alpar@156:  *
alpar@156:  * Copyright (C) 2003-2008
alpar@156:  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
alpar@156:  * (Egervary Research Group on Combinatorial Optimization, EGRES).
alpar@156:  *
alpar@156:  * Permission to use, modify and distribute this software is granted
alpar@156:  * provided that this copyright notice appears in all copies. For
alpar@156:  * precise terms see the accompanying LICENSE file.
alpar@156:  *
alpar@156:  * This software is provided "AS IS" with no warranty of any kind,
alpar@156:  * express or implied, and with no claim as to its suitability for any
alpar@156:  * purpose.
alpar@156:  *
alpar@156:  */
alpar@156: 
alpar@156: namespace lemon {
alpar@156: /*!
alpar@156: 
alpar@156: 
alpar@156: 
alpar@156: \page lgf-format Lemon Graph Format (LGF)
alpar@156: 
alpar@156: The \e LGF is a <em>column oriented</em>
alpar@156: file format for storing graphs and associated data like
alpar@156: node and edge maps.
alpar@156: 
alpar@156: Each line with \c '#' first non-whitespace
alpar@156: character is considered as a comment line.
alpar@156: 
alpar@156: Otherwise the file consists of sections starting with
alpar@156: a header line. The header lines starts with an \c '@' character followed by the
alpar@156: type of section. The standard section types are \c \@nodes, \c
alpar@156: \@arcs and \c \@edges
alpar@156: and \@attributes. Each header line may also have an optional
alpar@156: \e name, which can be use to distinguish the sections of the same
alpar@156: type.
alpar@156: 
alpar@156: The standard sections are column oriented, each line consists of
alpar@156: <em>token</em>s separated by whitespaces. A token can be \e plain or
alpar@156: \e quoted. A plain token is just a sequence of non-whitespace characters,
alpar@156: while a quoted token is a
alpar@156: character sequence surrounded by double quotes, and it can also
alpar@156: contain whitespaces and escape sequences. 
alpar@156: 
alpar@156: The \c \@nodes section describes a set of nodes and associated
alpar@156: maps. The first is a header line, it columns are the names of the
alpar@156: maps appearing in the following lines.
alpar@156: One of the maps must be called \c
alpar@156: "label", which plays special role in the file.
alpar@156: The following
alpar@156: non-empty lines until the next section describes nodes of the
alpar@156: graph. Each line contains the values of the node maps
alpar@156: associated to the current node.
alpar@156: 
alpar@156: \code
alpar@156:  @nodes
alpar@156:  label   coordinates size    title
alpar@156:  1       (10,20)     10      "First node"
alpar@156:  2       (80,80)     8       "Second node"
alpar@156:  3       (40,10)     10      "Third node"
alpar@156: \endcode
alpar@156: 
alpar@156: The \c \@arcs section is very similar to the \c \@nodes section,
alpar@156: it again starts with a header line describing the names of the arc,
alpar@156: but the \c "label" map is not obligatory here. The following lines
alpar@156: describe the arcs. The first two tokens of each line are
alpar@156: the source and the target node of the arc, respectively, then come the map
alpar@156: values. The source and target tokens must be node labels.
alpar@156: 
alpar@156: \code
alpar@156:  @arcs
alpar@156:  	      capacity
alpar@156:  1   2   16
alpar@156:  1   3   12
alpar@156:  2   3   18
alpar@156: \endcode
alpar@156: 
alpar@156: The \c \@edges is just a synonym of \c \@arcs.
alpar@156: 
alpar@156: The \c \@attributes section contains key-value pairs, each line
alpar@156: consists of two tokens, an attribute name, and then an attribute value.
alpar@156: 
alpar@156: \code
alpar@156:  @attributes
alpar@156:  source 1
alpar@156:  target 3
alpar@156:  caption "LEMON test digraph"
alpar@156: \endcode
alpar@156: 
deba@162: The \e LGF can contain extra sections, but there is no restriction on
deba@162: the format of such sections.
deba@162: 
alpar@156: */
alpar@156: }
alpar@156: 
alpar@156: //  LocalWords:  whitespace whitespaces