Introduction to Graphs (For real this time)
- A graph is used to encode relationships between objects.
- The objects
- Are represented as nodes or vertexes
- Frequently represented as $V$, with $v\in V$ a single vertex.
- Data is frequently stored at a vertex.
- The relationships
- Are represented as edges
- Frequently written as $E$, with $e \in E$ a single edge.
- Thus a graph $G = (V,E)$
- Some graph terminology
- Most graphs are undirected
- or if $e=(u,v), e \in E, u,v \in V$
- then $ (v,u) \in E$
- Or $(u,v) \in E \implies (v,u) \in E$
- But can be directed.
- Or $(u,v) \in E \mathrel{\rlap{\hskip .5em/}}\Longrightarrow (v,u) \in E$
- Frequently all edges have the same (or no) weight.
- But if the graph has weights associated with each edge it is a weighted graph.
- A tree is a special case of a graph.
- An acyclic graph has no cycles.
- Trees usually have a starting point or a root
- Trees are acyclic.
- A special case of a graph is a Directed Acyclic Graph or DAG.
- While we will not deal with these immediately.
- We will encounter them.
- A tree is a DAG
- But there are other DAGS as well.
- Application of graphs. Read this (P 74)
- Transportation , your GPSR
- Communication Networks.
- Informational Networks (web)
- Social Networks (friends)
- Dependency (make) (DAG)