graphs and trees Flashcards
graphs consist of…
nodes connected ny edges
path
a route from a starting node to a destination node
graph theory
a field of math that studies graphs, their properties, and their application
connected graphs
for any pair of nodes u and v, there is a path from u to v
connected graphs <->
disconnected
directed graphs
directed edges
weakly connected
there is a path between every pair of vertices in the undirected version of the graph
strongly connected
for every pair of vertices u and v, there is a directed path from u to v and a directed path from v to u.
cyclic
contains one or more cycles
acyclic
contains no cycles
weighted
edges have numerical values, called weight
DAG
directed acyclic graph
edges in non-weighted graphs carry binary information:
they do exist or they don’t
tree
and undirected graph in which any two nodes are connected by exactly one path, or equivalently a connected acyclic undirected graph
directed tree
DAG whose underlying undirected graph is a tree