View on GitHub

reading-notes

Graphs

A graph is a non-linear data structure that can be looked at as a collection of vertices (or nodes) potentially connected by line segments named edges.

Here is some common terminology used when working with Graphs:

Directed vs Undirected

An Undirected Graph is a graph where each edge is undirected or bi-directional. This means that the undirected graph does not move in any direction.

directed

Unlike an undirected graph, a Digraph has direction. Each node is directed at another node with a specific requirement of what node should be referenced next.

undirected

Complete vs Connected vs Disconnected

A complete graph is when all nodes are connected to all other nodes.

A connected graph is graph that has all of vertices/nodes have at least one edge.

A disconnected graph is a graph where some vertices may not have edges.

Acyclic vs Cyclic
Graph Representation

We represent graphs through:

adjacencymatrix

adjacencymatrix

Weighted Graph

A weighted graph is a graph with numbers assigned to its edges. These numbers are called weights. This is what a weighted graph looks like:

weightedgraph

resources:

https://codefellows.github.io/common_curriculum/data_structures_and_algorithms/Code_401/class-35/resources/graphs.html

Home Page