reading-notes

View the Project on GitHub Abu-laban/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.

Undirected Graphs

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

Vertices/Nodes = {a,b,c,d,e,f}

Edges = {(a,c),(a,d),(b,c),(b,f),(c,e),(d,e),(e,f)}

img

Directed Graphs (Digraph)

A _Directed Graph _ also called a Digraph is a graph where every edge is 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.

img

Vertices = {a,b,c,d,e,f}

Edges = {(a,c),(b,c),(b,f),(c,e),(d,a),(d,e)(e,c)(e,f)}

Complete vs Connected vs Disconnected

This depends on how connected the graphs are to other node/vertices.

Acyclic vs Cyclic

Graph Representation

We represent graphs through:

Real World Uses of Graphs

Graphs are extremely popular when it comes to it’s uses. Here are just a few examples of graphs in use: