Graphs: Examples and Definitions

Week 12, Wednesday

March 25, 2026

The internet!! (circa 2003)

Graph (V,E):

   V:   ___________________

   E:   ___________________

 

Subgraph:

\(G'=(V',E')\) is a subgraph of \(G=(V,E)\) iff \(V'\subseteq V\) and \(E'\subseteq E\) and \((u,v)\in E'\to u\in V'\) and \(v\in V'\).

 

Degree(v): number of edges that touch vertex v.

Conflict Graph

Graph (V,E):

   V:   ___________________

   E:   ___________________

   Aux: _________________

 

Adjacent Vertices, N(v): \(\{u:(u,v)\in E\}\)

Incident Edges, I(v): \(\{(u,v)\in E\}\)

 

Aside: _________________________

State Space Graph

Graph (V,E):

   V:   ___________________

   E:   ___________________

 

Path: sequence of vertices \(\{u_0,u_1,\ldots u_n\}\) where \((u_i,u_{i+1})\in E,\;\forall i\in\{0\ldots n-1\}\)

 

How do we find solution?

Surface Mesh

Graph (V,E):

   V:   ___________________

   E:   ___________________

   Aux: _________________

 

Planar Graph: a graph that can be drawn in the plane with no crossing edges.

Check Divisibility by 7

  1. Start at the circle node at the top.
  2. For each digit \(d\), follow \(d\) blue (solid) edges, followed by 1 red (dashed) edge.
  3. If you end up at the circle node, your number is divisible by 7.

Example: 3703

Walk: Sequence of vertices between which there are edges

Trail: Walk with no repeated edges

Path(alt): Walk with no repeated vertices

Circuit: Trail that begins and ends in same place

Cycle: Path that begins and ends in same place

Conversation Analysis

Graph (V,E):

   V:   ___________________

   E:   ___________________

 

Complete Graph:

A graph \(G=(V,E)\) is complete iff \(\forall u,v\in V,\;(u,v)\in E\).

Social Network

Graph (V,E):

   V:   ___________________

   E:   ___________________

 

Connected (sub)graph: a (sub)graph \(G=(V,E)\) is connected if there is a path from \(u\) to \(v\) \(\forall u,v\in V\).

Connected Component: a maximal connected subgraph.

Spanning Tree: connected, acyclic subgraph, containing all the vertices in \(V\).

Collaboration Graph

Graph (V,E):

   V:   ___________________

   E:   ___________________

 

Sparse Graph:

\(|E| = O(|V|)\)

Downtown Vancouver

Graph (V,E):

   V:   ___________________

   E:   ___________________

 

Directed Graph: each edge \((u,v)\) is ordered — \((u,v) \neq (v,u)\). Streets like Howe (↓) and Seymour (↑) make this directed.

Weighted Graph: each edge carries a weight \(w(u,v)\) — here, travel time in minutes.

In/Out-degree(v): # edges directed into / out of \(v\). A one-way intersection has in-degree \(\neq\) out-degree.

 

Fastest route: Seymour & Georgia → Burrard & Helmcken?

Graph Vocabulary

b a c e d g f n m o k l j i h p q 8 9 6 7 4 5 2 3 0 1 G = (V,E) |V| = n |E| = m
  1. List the edges incident on vertex b:
  2. What is the degree of vertex h?
  3. List all vertices adjacent to vertex i:
  4. Describe a path from p to o:
  5. Describe a path from 6 to g:
  6. List the vertices in the largest complete subgraph in G:
  7. Describe the largest connected subgraph in G:
  8. Describe the connected components in G:
  9. How many edges in a spanning forest of G?
  10. How many paths from 0 to 9?
  11. Can you draw G with no crossing edges?

Bounds

\(G = (V,E) \qquad |V| = n \qquad |E| = m\)

Running times are often reported in terms of \(n\), the number of vertices, but they often depend on \(m\), the number of edges.

 

Suppose \(n = 100\) vertices…

 

Give a lower bound on \(|E|\):   ______

 

Give an upper bound on \(|E|\):   ______

Handshaking

\(G = (V,E) \qquad |V| = n \qquad |E| = m\)

How many edges?

Activity: Pencil Puzzles

You each have a graph. Do these three things:

  1. Try to trace every edge exactly once without lifting your pencil.

  2. Come up with a rule that you can use to determine if a trace is possible.

  3. Devise an algorithm that will find a trace if it exists.

What’s left?

How do we get from here to there? Need:

1. Common Vocabulary

2. Graph implementation

3. Traversal

4. Algorithms.