GRAPHS Flashcards
What is graph
Mathematically, a graph is a set V of vertices and a set E of edges, such that each edge in E connects two of the vertices in V
We use node as a synonym for vertex
Draw unlabeled, labeled and weighted graphs
*See notes for graph
When are vertices adjacent to each other?
One vertex is adjacent to another vertex if there is an edge connecting the two vertices (neighbors)
What is a path?
Sequence of edges that allows one vertex to be reached from another vertex in a graph
What is the length of a path and the degree of a vertex?
Length of a path: Number of edges on the path
Degree of a vertex: Number of edges connected to it
Define and illustrate simple path and cycles
Simple path: Path that does not pass through the same vertex more than once
Cycle: Path that begins and ends at the same vertex
When is a graph said to be connected?
A graph is connected if there is a path from each vertex to every other vertex
*See notes for pic
When is a graph said to be complete?
A graph is complete if there is an edge from each vertex to every other vertex
What are the two types of graphs? Illustrate each
Graphs can be undirected or directed (digraph)
*See notes for pic
Define: Directed edges and incident edges
A directed edge has a source vertex and a destination vertex
Edges emanating from a given source vertex are called its incident edges
How does one convert an undirected graph to a directed graph
To convert undirected graph to equivalent directed graph, replace each edge in undirected graph with a pair of edges pointing in opposite directions
What is a DAG?
A special case of digraph that contains no cycles is known as a directed acyclic graph, or DAG
Give examples of graph applications?
A roadmap
A map of airline routes
A schematic of the computers and connections that make up the Internet
The links between pages on the Web
The relationship between students and courses i.e courses and their pre-requisites
A diagram of the flow capacities in a communications or transportation network
What are the common ways to represent graphs?
The adjacency matrix
The adjacency list
What is an adjacency list?
The adjacency list for the graph is an array of N linked lists
Each individual list shows what vertices a given vertex is adjacent to.
Adjacency list shows which vertices are adjacent to—that is, one edge away from—a given vertex, not paths from vertex to vertex.
*See notes for illustration