equal
deleted
inserted
replaced
30 directive is added to the code at the beginning. |
30 directive is added to the code at the beginning. |
31 |
31 |
32 [SEC]sec_digraphs[SEC] Directed Graphs |
32 [SEC]sec_digraphs[SEC] Directed Graphs |
33 |
33 |
34 This section tells you how to work with a directed graph (\e digraph, |
34 This section tells you how to work with a directed graph (\e digraph, |
35 for short) in LEMON. |
35 for short) in LEMON. Here we use \ref ListDigraph, the most versatile |
36 The library provides various digraph structures for both general and special |
36 digraph structure. (The library also provides other digraph types, |
37 purposes. Here we use \c ListDigraph, the most versatile digraph type. |
37 see \ref sec_graph_structures "later".) |
38 |
38 |
39 The nodes and the arcs of a graph are identified by two data types called |
39 The nodes and the arcs of a graph are identified by two data types called |
40 \ref concepts::Digraph::Node "ListDigraph::Node" and \ref concepts::Digraph::Arc |
40 \ref concepts::Digraph::Node "ListDigraph::Node" and \ref concepts::Digraph::Arc |
41 "ListDigraph::Arc". You can add new items to the graph using the member |
41 "ListDigraph::Arc". You can add new items to the graph using the member |
42 functions \ref ListDigraph::addNode() "addNode()" and |
42 functions \ref ListDigraph::addNode() "addNode()" and |
60 \code |
60 \code |
61 ListDigraph::Arc arc = g.addArc(a,c); |
61 ListDigraph::Arc arc = g.addArc(a,c); |
62 \endcode |
62 \endcode |
63 |
63 |
64 \note Using ListDigraph, you can also remove nodes or arcs with the |
64 \note Using ListDigraph, you can also remove nodes or arcs with the |
65 \ref ListDigraph::erase() "erase()" function. |
65 \ref ListDigraph::erase() "erase()" function. Moreover, this class provides |
|
66 several other operations, see its \ref ListDigraph "documentation" for more |
|
67 information. |
66 However, not all graph structures support the addition and deletion |
68 However, not all graph structures support the addition and deletion |
67 of graph items. |
69 of graph items (see \ref sec_graph_concepts). |
68 |
70 |
69 Two important member functions of the directed graphs are |
71 Two important member functions of the directed graphs are |
70 \ref concepts::Digraph::source() "source()" |
72 \ref concepts::Digraph::source() "source()" |
71 and \ref concepts::Digraph::target() "target()". |
73 and \ref concepts::Digraph::target() "target()". |
72 They give back the two end nodes of an arc. |
74 They give back the two end nodes of an arc. |