Algorithms, Naveed Flashcards
What is a graph?
A pair of sets G=(V,E) where V is a set of vertices and E is a set of edges
What is a edge?
A pair of distinct vertices
How to know if v is adjacent to u?
If (v,u) is element of E
When is an edge incident on a vertice?
When e = (u,v)
What is the degree of a vertex?
The number of edges that are incident on it
What is a complete graph?
A graph where every vertex is adjacent to every other vertex. We use Kn to denote a complete graph
What is the complement of graph G?
G=(V,E) H is a compliment of G iff H=(V,F) where F = E(Kv)-E
When is G’ a subgraph of G?
iff V’≤V and E’≤E
when is G’ a vertex induced subgraph of G?
iff E’={(u,v)|(v,u) element of E and u,v ≤ V’}
what is a walk of a graph G
a walk P of graph G is a finite sequence P=v0,e0,v1,…,ek,vk begining and ending with a vertex, each edge is incident on the vertex preceding and following it
what is a tour?
A walk with distinct edges
what is an open walk?
a walk with distinct terminal vertices
what is a path?
an open walk with no vertex appearing more than once
what is the length of a path?
the number of edges in it
what is a cycle?
a path with identical terminal vertices and length > 2
When are to vertices connected?
When there is a path between them.
When is a graph connected?
For each u,v in G there is a path (u,v)
What is a maximal subgraph?
The largest subgraph that has a given property. i.e. if one more vertex was added from the superset to the subgraph, then the property would break
What is a maximally connected subgraph?
The largest subgraph with all the vertices connected.
What is the connected component of a graph?
The maximally connected subgraph
What is a tree
a connected graph with no cycles
What is a clique
a subset if vertices such that every two distinct vertices in the clique are adjacent.
What is a directed graph?
Like a normal graph but the order of the vertices in an edge matter
When is v in-edge?
When v is the second vertice in directed edge (u,v)