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...

Information Retreival System: Implementation

NCBI provides an information retrieval system, Entrez, designed to provide user friendly access to biomedical data including structural, molecular, sequences and literature.   Entrez provides access and searching facilities to more than 30 databases of genome, health, structural, literature, sequence and chemical. It provides faecet, limited and advance searching option with Boolean operators to customize user’s query. It also facilitates querying with wild card characters, mapping and controlled vocabulary. Web implementation of Entrez has more valuable applications and benefits over Network Entrez as it facilitates searching with a tremendous amount of data in different databases. Entrez provides navigational links between different databases either provided by NCBI or external (journal/databases) for each record by using two types of relationships: neighbors and hard links. Both of these types of relationships have been found on the basis of controlled vocabulary and algor...

How genetic algorithm works in Bioinformatics?

A.     Initialization Originally various individual solutions are generated arbitrarily to build initial population. Size of population depends on problem nature, but typically it carries several hundred to several thousand possible solutions. Usually, the population is created arbitrarily, covering the complete range of probable solutions. Sometimes solutions may be “seeded” where there is a chance of optimal solutions. B.     Selection During every consecutive generation, a fraction of the present population is chosen for breeding a new generation. Fitness-based process chooses individual solutions, where solutions measured through functions of fitness are usually likely to be chosen. Many selection procedures rate the fitness for every solution and specially select the one best solution among all. Some other procedures rate just a random population sample, because this procedure may be inefficient in terms of time. Most functions are designed ...