doc/basic_concepts.dox
changeset 2524 44675961f645
parent 2391 14a343be7a5a
child 2553 bfced05fa852
equal deleted inserted replaced
3:649d4fc21559 4:d9ae5dda7123
    27 every structural information of the graph. The structural manipulations are also
    27 every structural information of the graph. The structural manipulations are also
    28 provided by the graph object. There is no universal graph class instead we have
    28 provided by the graph object. There is no universal graph class instead we have
    29 different classes for different purposes. They can differ in many ways, but all
    29 different classes for different purposes. They can differ in many ways, but all
    30 have to satisfy one or more \ref concept "graph concepts" which are standardized
    30 have to satisfy one or more \ref concept "graph concepts" which are standardized
    31 interfaces to work with the rest of the library. The most basic concept is the
    31 interfaces to work with the rest of the library. The most basic concept is the
    32 \ref Graph.<br>
    32 \ref concepts::Graph "Graph".<br>
    33 A good example is the \ref ListGraph which we already know from Hello World and
    33 A good example is the \ref ListGraph which we already know from Hello World and
    34 will be used in our examples as well.
    34 will be used in our examples as well.
    35 
    35 
    36 One main advantage of the templates are, that you can write your own graph classes.
    36 One main advantage of the templates are, that you can write your own graph classes.
    37 As long as they provide the interface a concept is defining all the LEMON algorithms
    37 As long as they provide the interface a concept is defining all the LEMON algorithms
    45 \code lemon::ListGraph::Node \endcode
    45 \code lemon::ListGraph::Node \endcode
    46 
    46 
    47 If the graph fits the ExtendableGraphComponent concept, then you can add new nodes
    47 If the graph fits the ExtendableGraphComponent concept, then you can add new nodes
    48 to the graph with the addNode() member function. It returns the newly added node
    48 to the graph with the addNode() member function. It returns the newly added node
    49 (as value). So if you need the new node to do something useful with, for example
    49 (as value). So if you need the new node to do something useful with, for example
    50 create an edge, assign a value to it through \ref map1 maps.
    50 create an edge, assign a value to it through \ref maps1 maps.
    51 \code lemon::ListGraph::Node  new_node = graph.addNode(); \endcode
    51 \code lemon::ListGraph::Node  new_node = graph.addNode(); \endcode
    52 
    52 
    53 If the graph fits into the ErasableGraphComponent concept you can also remove nodes
    53 If the graph fits into the ErasableGraphComponent concept you can also remove nodes
    54 from the graph with the erase() member function.
    54 from the graph with the erase() member function.
    55 \code graph.erase( new_node ); \endcode
    55 \code graph.erase( new_node ); \endcode
   112 warranty that the next time the iteration will give us the nodes in the same order.
   112 warranty that the next time the iteration will give us the nodes in the same order.
   113 Don't use this order to identify nodes! Use the \c id() member function of the
   113 Don't use this order to identify nodes! Use the \c id() member function of the
   114 graph class described above. (There is a powerful technique using maps right in
   114 graph class described above. (There is a powerful technique using maps right in
   115 the next page.)
   115 the next page.)
   116 
   116 
   117 The \ref EdgeIt works exactly the same - nothing more to say. But there are \ref InEdgeIt
   117 The \ref concepts::Graph::EdgeIt "EdgeIt" works exactly the same - nothing more to say.
   118 and \ref OutEdgeIt by directed graphs and \ref IncEdgeIt by undirected graphs.
   118 But there are \ref concepts::Graph::InEdgeIt "InEdgeIt" and
       
   119 \ref concepts::Graph::OutEdgeIt "OutEdgeIt" by directed graphs and
       
   120 \ref concepts::UGraph::IncEdgeIt "IncEdgeIt" by undirected graphs.
   119 They take two arguments. The first is a graph, the second is certain node of the
   121 They take two arguments. The first is a graph, the second is certain node of the
   120 graph. InEdgeIt iterates on the incoming edges of that node and OutEdgeIt does it
   122 graph. InEdgeIt iterates on the incoming edges of that node and OutEdgeIt does it
   121 on the outgoing edges. The IncEdgeIt of course iterates every edge connecting to
   123 on the outgoing edges. The IncEdgeIt of course iterates every edge connecting to
   122 the given node.
   124 the given node.
   123 
   125