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

Genetic algorithm and its applications in medicine

With the increase in biological and medical data it has become necessary for medical and bioinformaticians to have some automated approaches to identify different patterns it their data, so as to predict or have some useful information. Many applications have been described above for genetic algorithm, along with these applications GA has been applied in protein structure prediction, RNA structure prediction and Motif finding. Basic steps of GA are almost same in many applications but it requires expertise, parameters and involves a huge number of randomness and can provide different results in outcomes.      Applications of Genetic Algorithm in medicine Oncology Screening tests suggests a valuable chance cancer detection at early stages, which when keep an eye on by proper handling could recover the patient’s survival rate. Developing a non-invasive procedure for the detection of cervical cancer, Duraipandian et al, using colposcopy developed Raman spectra ...

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