Skip to main content

frequently asked questions about Depth -First Search (DFS)



Recall Depth-first Search (DFS), and Show that edge (u, v) is

a)         a tree edge or forward edge if and only if d[u] < d[v] < f[v] < f[u]





b)         a back edge if and only if d[v] < d[u] < f[u] < f[v] 

c)         a cross edge if and only if d[v] < f[v] < d[u] < f[u]

 

 

Solution:

By theorem, DFS of (undirected/directed) Graph let’s say G, where G= (V, E) and we have two vertices u and v such that they hold





·         Vertex u and vertex v are not successor of each other, and intervals d[u], f[u], d[v] and f[v] are disjoint.
·         Vertex u is descendant of vertex v and the interval d[u], f[u] is confined inside interval d[v] and f[v]
·         Vertex v, descendant of vertex u and the interval of d[v] and f[v] confined inside interval d[u] and f[u]




By corollary, vertex v is a successor of vertex u if and only if d[u], is less than d[v], is less than f[v], and it is less than < f[u].





a)         a tree edge or forward edge if and only if d[u] < d[v] < f[v] < f[u]


Edge (u, v) is a forward edge if and only if vertex v is a successor of vertex u, or in other case it is back edge if and only if vertex u is a successor of vertex v, or in other case it is a cross edge if and only if neither vertex u nor vertex v are successor of each other.
The edge between Vertex u and vertex v is forward edge, if vertex v is a successor of vertex u, and v is successor of vertex u  if and only if we have d[u] < d[v] < f[v] < f[u] , hence it is proved






b)         a back edge if and only if d[v] < d[u] < f[u] < f[v] 

Let’s say edge between vertex u and vertex v is back edge then if this self-loop is a back edge then (d[v] is equal to d[u]), which is less then (f[u] equals to f[v]) holds. U is successor of vertex v and edge between u and v contains no self-loop and by corollary; d[v] < d[u] < f[u] < f[v]. Let’s say d[v] is less than and equals to d[u] and it is less then  f[u] and it is less then and equals to f[v], in such case, vertex u and vertex v are same. d[v] is equals to d[u] < f[u] equals to f[v], and edge between u and v is self-loop. Hence, it is a back edge and in such case of vertex u and vertex v d[v] is less than d[u] < f[u] less than f[v],
Vertex u is a successor of vertex v, interval d[u] and f[u] is confined within d[v] and f[v], so it is back edge. Proved

 

c)         a cross edge if and only if d[v] < f[v] < d[u] < f[u]




Let’s suppose edge between vertex u and vertex v is a cross edge. In this case neither vertex u nor vertex v is predecessor of each other. Different intervals d[u], f[u], d[v] and f[v] are separate. So either d[v] < f[v] < d[u] < f[u] is true or d[u] < f[u] < d[v] < f[v] is true. If cross edge between u and v exists then we cannot have the relationship of d[u] < d[v] as vertex v is a successor of vertex u. If relationship exists such that d[u] is less then d[v], in such case vertex v is remains white in color at d[u] time which opposes cross edge. Hence, d[v] is less then f[v]  and it is less then d[u] , it is less then f[u]. By theorem, neither vertex u nor vertex v is successor of each other
Hence, the edge between vertex u and vertex v, they must have a across edge. Proved





Comments

Popular posts from this blog

Information Retreival Systems in Bioinformatics: Entrez

Currently many biological databases have been developed and became an important toolbox for every scientist in research and academic purpose. Searching a sequence homologue of either Protein, DNA or to know the novelty of a sequence, one needs to do a sequence search against available databases. Similarly, searching for Open Reading Frame, structure, functional, regulatory sequences and repeated elements, we also need to search our query against different available databases. As biological data is increasing with the passage of time, its tremendous growth requires a searching and access system to retrieve useful information. In biological data, three retrieval systems are widely used relevant to a scientific need, it includes: Entrez, Sequence Retrieval System also known as SRS and DBGET. These retrieval systems let its user a text search against multiple molecular databases and also provides useful relevant information in the forms of links either internal or external to our qu...

Comparison between Shared memory architecture and Shared nothing architecture

Shared-Memory Architecture: This architecture connects different processor under one operating system through high speed interconnections (cross-bar switch or high speed bus etc). Query response time is reduced by dividing workload to any connected processor with least or no workload. This architecture provides two main advantages over other architectures as it manages load in a perfect manner and easy to manage. It uses least busy processors and allocates new tasks to it so that query processing is done at a fast speed. But along with two major advantages it has three basic disadvantages too. These are low availability, any fault or problem may affect most of the processors making less availability, high cost to link processors and third, limited extensible. Performance   Shared memory architecture provides a good performance as compared to shared nothing architecture by balancing query load on a processor with less or no work load. So...

BioMart: An Innovative and Unified Access To Biological Databases

BioMart: Recently, new high-throughput techniques have developed and increased biomedical data both in terms of complexity and quantity. However, many bioinformatics resources have been created to link significant newly generated information with previous one. Each of these resources have their own method for querying and processing information, causing problems for a scientist to use these resources in their research work. Another challenge faced by scientist is to compile results from the available resources even from few available resources due to lack of data catalogue and navigation between the existing resources by using different query interfaces. Another problem is to maintain or generate their own independent data sets. All of these problems need to be address by some common interface to facilitate research work by generating, managing data and distributing them among different scientists in some easy and simple way. All of these challenges are addressed by BioMart pr...