1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
|
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<chapter id="igraph-Basic">
<title>About &igraph; graphs, the basic interface</title>
<section id="igraph-data-model"><title>The &igraph; data model</title>
<para>
The &igraph; library can handle directed and
undirected graphs. The &igraph; graphs are multisets
of ordered (if directed) or unordered (if undirected) labeled pairs.
The labels of the pairs plus the number of vertices always starts with
zero and ends with the number of edges minus one. In addition to that
a table of metadata is also attached to every graph, its most
important entries are the number of vertices in the graph and whether
the graph is directed or undirected.
</para>
<para>
Like the edges, the &igraph; vertices are also
labeled by numbers between zero and the number of vertices minus one.
So, to summarize, a directed graph can be imagined like this:
<informalexample>
<programlisting>
( vertices: 6,
directed: yes,
{
(0,2),
(2,2),
(2,3),
(3,3),
(3,4),
(3,4),
(4,1)
}
)
</programlisting>
</informalexample>
Here the edges are ordered pairs or vertex ids, and the graph is a multiset
of edges plus some meta-data.
</para>
<para>
An undirected graph is like this:
<informalexample>
<programlisting>
( vertices: 6,
directed: no,
{
{0,2},
{2},
{2,3},
{3},
{3,4},
{3,4},
{4,1}
}
)
</programlisting>
</informalexample>
Here an edge is a set of one or two vertex ids, two for most of the
time, except for loop edges. A graph is a multiset of edges plus meta data,
just like in the directed case.
</para>
<para>It is possible to convert a directed graph to an undirected one,
see the <link linkend="igraph_to_directed">
<function>igraph_to_directed()</function></link>
and <link linkend="igraph_to_undirected">
<function>igraph_to_undirected()</function></link> functions.
</para>
<para>Note that &igraph; has some limited support for
graphs with multiple edges. The support means that multiple edges can
be stored in &igraph; graphs, but for most functions
(like <link linkend="igraph_betweenness">
<function>igraph_betweenness()</function></link>) it is not checked
that they work well on graphs with multiple edges.
To eliminate multiple edges from a graph, you can use
<link linkend="igraph_simplify">
<function>igraph_simplify()</function></link>.
</para>
</section>
<section id="basic-interface"><title>The basic interface</title>
<!-- doxrox-include about_basic_interface -->
<section id="graph-constructors-and-destructors"><title>Graph Constructors and Destructors</title>
<!-- doxrox-include igraph_empty -->
<!-- doxrox-include igraph_empty_attrs -->
<!-- doxrox-include igraph_copy -->
<!-- doxrox-include igraph_destroy -->
</section>
<section id="basic-query-operations"><title>Basic Query Operations</title>
<!-- doxrox-include igraph_vcount -->
<!-- doxrox-include igraph_ecount -->
<!-- doxrox-include igraph_edge -->
<!-- doxrox-include IGRAPH_FROM -->
<!-- doxrox-include IGRAPH_TO -->
<!-- doxrox-include IGRAPH_OTHER -->
<!-- doxrox-include igraph_get_eid -->
<!-- doxrox-include igraph_get_eids -->
<!-- doxrox-include igraph_get_eids_multi -->
<!-- doxrox-include igraph_neighbors -->
<!-- doxrox-include igraph_incident -->
<!-- doxrox-include igraph_is_directed -->
<!-- doxrox-include igraph_is_same_graph -->
<!-- doxrox-include igraph_degree -->
</section>
<section id="adding-and-deleting-vertices-and-edges"><title>Adding and Deleting Vertices and Edges</title>
<!-- doxrox-include igraph_add_edge -->
<!-- doxrox-include igraph_add_edges -->
<!-- doxrox-include igraph_add_vertices -->
<!-- doxrox-include igraph_delete_edges -->
<!-- doxrox-include igraph_delete_vertices -->
</section>
</section>
</chapter>
|