BASIC GRAPH CONCEPTS in .NET

Printing QR Code 2d barcode in .NET BASIC GRAPH CONCEPTS
BASIC GRAPH CONCEPTS
Reading QR Code In Visual Studio .NET
Using Barcode Control SDK for .NET framework Control to generate, create, read, scan barcode image in VS .NET applications.
of all predecessors of v is denoted by pred(v) and the set {x V : evx E} of all successors of v, is denoted by succ(v) A vertex w is called ancestor of vertex v if there is a path p(w v) from w to v, and the set of all ancestors of v is denoted by ance(v) = {x V : p(x v) G} Logically, a vertex w is called descendant of vertex v if there is a path p(v w), and the set of all descendants of v is denoted by desc(v) = {x V : p(v x) G} In the latter case it is sometimes said that vertex w is reachable from v Obviously, all predecessors are also ancestors and all successors are also descendants Alternative notations are sometimes used when appropriate, for example, child or parent, given the analogy to the pedigree These are some examples from the directed graph in Figure 31(b): vertex x is a predecessor of v, which is a successor of u; hence, the set of predecessors of v is pred(v) = {u, x} The set of successors of w only comprises the single vertex x, succ(w) = {x} Finally, vertex u is an ancestor of w and v is a descendent of w, but also its ancestor As seen in the examples above, a vertex relation is not necessarily unique in a cyclic graph Lemma 32 (Vertex Relationships in Cycle) A vertex v belonging to a cycle path pc is for any vertex of the cycle, u pc , u = v, an ancestor and a descendant at the same time Proof The lemma follows directly from Lemma 31 and the notion of ancestor and descendant, since in a cycle pc , for every two vertices u and v, u, v pc , u = v, there are two subpaths p(u v) and p(v u) Based on the notions of predecessors and successors, two vertex types can be further distinguished in a directed graph De nition 35 (Source Vertex and Sink Vertex) In a directed graph G = (V, E), a vertex v V having no predecessors, pred(v) = , is named source vertex and a vertex u V having no successors, succ(v) = , is named sink vertex Alternative notations for source vertex and sink vertex are entry vertex and exit vertex, respectively The set of source vertices in a directed graph G is denoted by source(G) = {v V : pred(v) = } and the set of sink vertices by sink(G) = {v V : succ(v) = } 311 Computer Representation of Graphs For the complexity analysis of graph-based algorithms, in time and space, it is essential to consider the computer representation of graphs There are two standard ways to represent a graph G = (V, E): as a collection of adjacency lists or as an adjacency matrix (Cormen et al [42])
QR Code Creator In .NET
Using Barcode creation for .NET framework Control to generate, create QR-Code image in Visual Studio .NET applications.
GRAPH REPRESENTATIONS
QR Code Recognizer In .NET
Using Barcode reader for VS .NET Control to read, scan read, scan image in .NET framework applications.
Figure 32 The adjacency list representations of the two graphs in Figure 31: (a) for the undirected graph and (b) for the directed graph
Create Bar Code In .NET Framework
Using Barcode maker for Visual Studio .NET Control to generate, create bar code image in .NET applications.
Adjacency List Representation A graph can be represented as an array of |V| adjacency lists, one for each vertex in V The adjacency list belonging to vertex u V contains pointers to all vertices v that are adjacent to u; hence, there is an edge euv E In other words, in vertex u s adjacency list the elements of adj(u) are stored in arbitrary order Figure 32 shows the adjacency list representations of the two sample graphs in Figure 31; in Figure 32(a) the one for the undirected graph and in Figure 32(b) the one for the directed graph For the directed graph, the sum of the lengths of the adjacency lists is |E|, because for each edge euv the destination vertex v appears once in the list of vertex u For an undirected graph every edge euv appears twice, once in the list of u and once in the list of v, due to the symmetry of the undirected edge; thus, the sum of the lengths of the adjacency list is 2|E| Clearly, this representation form describes a graph G completely, as there is a list for every vertex and at least one entry for every edge The amount of memory required for a graph, directed or undirected, is consequently O(V + E) In the previous asymptotic notation of the complexity, a common notational convention was adopted The sign | | for the cardinality (or size) of sets was omitted and it was written O(V + E) instead of O(|V| + |E|) This shall be used in all asymptotic notations, but only there, since it makes them more readable and is nonambiguous The adjacency list representation has the disadvantage that there is no quicker way to determine if an edge euv is part of a graph G than to search in u s adjacency list Adjacency Matrix Representation The alternative representation of a graph as an adjacency matrix overcomes this shortcoming A graph is represented by a |V| |V| matrix A and it is assumed that the vertices are indexed 1, 2, , |V| in some arbitrary manner Each element aij of the matrix A has one of two possible values: 1 if the edge eij E and 0 otherwise Figure 33 depicts the two adjacency matrices for the graphs of Figure 31 with the vertices u, v, w, x numbered 1, 2, 3, 4, respectively Owing to the symmetry of undirected edges, the matrix of an undirected graph is symmetric along its main diagonal, which can be observed in the matrix of Figure 33(a) As the matrix is of size |V| |V|, the memory requirement of the adjacency matrix representation is O(V2 )
Bar Code Scanner In VS .NET
Using Barcode recognizer for .NET framework Control to read, scan read, scan image in .NET applications.
Make QR Code JIS X 0510 In C#.NET
Using Barcode printer for VS .NET Control to generate, create QR Code JIS X 0510 image in Visual Studio .NET applications.
QR Code Creation In Visual Basic .NET
Using Barcode printer for .NET Control to generate, create Quick Response Code image in VS .NET applications.
UPC Symbol Creation In .NET
Using Barcode creator for .NET Control to generate, create UCC - 12 image in VS .NET applications.
ISBN Drawer In VS .NET
Using Barcode printer for .NET Control to generate, create ISBN - 13 image in .NET framework applications.
Drawing Barcode In VB.NET
Using Barcode generator for Visual Studio .NET Control to generate, create barcode image in .NET applications.
Scan Barcode In Visual Studio .NET
Using Barcode decoder for Visual Studio .NET Control to read, scan read, scan image in Visual Studio .NET applications.
EAN13 Creation In Java
Using Barcode maker for Java Control to generate, create EAN-13 Supplement 5 image in Java applications.
Create GS1-128 In C#
Using Barcode generation for Visual Studio .NET Control to generate, create GS1 128 image in .NET applications.