Graph theory Flashcards
Define transitivity for a graph
if a is related to b and b is related to c then a must be related to c.
Imagine you have Gi, Gj graphs how would you figure out whether they are isomorphic to each other?
- Look at each graph’s degree and determine if it matches with another graph. if no (it is subset in the partition)
- if all vertices in Gi have an equal degree with Gj then they are isomorphic.
What does degree mean?
The number of edges a vertical has on an undirected graph.
in a directed graph; what is the difference between out-neighbor and in-neighbor?
out-neighbor: any other vertex that can be reached by following an edge that points away from the given vertex. EX A->B then B is out-nerighbor.
in-neighbor: any vertex from which the given vertex can be reached by following an edge that points towards the given vertex. EX A<-B then B is a in-neighbor
in a directed graph; what is the difference between out-degree and in-degree?
Out-degree is the number of edges going out from that vertex to other vertices (number of out-neighbors)
hin-degree of a vertex is the number of edges coming into that vertex from other vertices (the number of in-neighbors).
what word do you use when you want to solve algorithms in an alphabetic order?
lexiographic order
How would you describe DFS
You want to find the route that go farthest before backtracking
How would you decribe BFS?
Explores all neighbors before moving to the next
How would you do Topological sort?
- consider in lexiographic order the directed edges and note delevery/finish-time.
call DFS to compute finish time
as vertex v finished, add to front of list
How would you do SCC(strongly connected components)
- in lexicographic order consider directed edges and note discovery/finish time.
- group vertacies
- note in krøllet parenteser your grouped vertcies.