]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | <HTML> |
2 | <!-- | |
3 | Copyright (c) Jeremy Siek 2001 | |
4 | ||
5 | Distributed under the Boost Software License, Version 1.0. | |
6 | (See accompanying file LICENSE_1_0.txt or copy at | |
7 | http://www.boost.org/LICENSE_1_0.txt) | |
8 | --> | |
9 | <Head> | |
10 | <Title>Vertex Mutable Graph</Title> | |
11 | <BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b" | |
12 | ALINK="#ff0000"> | |
13 | <IMG SRC="../../../boost.png" | |
14 | ALT="C++ Boost" width="277" height="86"> | |
15 | ||
16 | <BR Clear> | |
17 | ||
18 | <H2><A NAME="concept:VertexMutableGraph"> | |
19 | Vertex Mutable Graph | |
20 | </H2> | |
21 | ||
22 | A vertex mutable graph can be changed by adding or removing | |
23 | vertices. The memory management is the responsibility of the graph | |
24 | implementation. The graph user need only make calls to | |
25 | <TT>add_vertex</TT> and <TT>remove_vertex</TT> and the graph | |
26 | implementation does the rest. | |
27 | ||
28 | <H3>Refinement of</H3> | |
29 | ||
30 | <a href="./Graph.html">Graph</a> and <a | |
31 | href="http://www.sgi.com/tech/stl/DefaultConstructible.html">DefaultConstructible</a> | |
32 | ||
33 | <H3>Associated Types</H3> | |
34 | ||
35 | No additional associated types. | |
36 | ||
37 | <h3>Valid Expressions</h3> | |
38 | ||
39 | <ul> | |
40 | <li><a name="sec:add_vertex"><TT>add_vertex(g)</TT></a> | |
41 | <b>returns</b> <TT>vertex_descriptor</TT> | |
42 | <br><br> | |
43 | ||
44 | <b>Semantics:</b> Add a new vertex to the graph. The | |
45 | <TT>vertex_descriptor</TT> for the new vertex is returned.<br> | |
46 | </li> | |
47 | ||
48 | <li><a name="sec:remove_vertex"><tt>remove_vertex(u, g)</tt></a> | |
49 | <b>returns</b> <tt>void</tt><br><br> | |
50 | ||
51 | <b> Semantics:</b> Remove <i>u</i> from the vertex set of the graph. | |
52 | <br> | |
53 | <b> Preconditions:</b> <i>u</i> is a valid vertex descriptor of graph <i>g</i> | |
54 | and there are no edges incident to vertex <i>u</i>. The function | |
55 | <TT>clear_vertex</TT> can be used to remove all incident edges. | |
56 | <br> | |
57 | <b> Postconditions: </b> <TT>num_vertices(g)</TT> is one less; <i>u</i> | |
58 | no longer appears in the vertex set of the graph and it | |
59 | is no longer a valid vertex descriptor. | |
60 | </li> | |
61 | ||
62 | </ul> | |
63 | ||
64 | <H3>Complexity guarantees</H3> | |
65 | <ul> | |
66 | <li> Vertex insertion is guaranteed to be amortized constant time. | |
67 | ||
68 | <li> Vertex removal is at most <TT>O(|E| + |V|)</TT>. | |
69 | </ul> | |
70 | ||
71 | ||
72 | <br> | |
73 | <HR> | |
74 | <TABLE> | |
75 | <TR valign=top> | |
76 | <TD nowrap>Copyright © 2000-2001</TD><TD> | |
77 | <A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>) | |
78 | <A HREF="http://www.boost.org/people/jeremy_siek.htm">Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@cs.indiana.edu">llee@cs.indiana.edu</A>) | |
79 | </TD></TR></TABLE> | |
80 | ||
81 | </BODY> | |
82 | </HTML> | |
83 |