reading-notes-ma


Project maintained by mohnalkhateeb Hosted on GitHub Pages — Theme by mattgraham

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.

some common terminology used when working with Graphs:

Directed vs Undirected

Undirected Graphs

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. undirectedG

Directed Graphs (Digraph)

Dgragh

Complete vs Connected vs Disconnected

Complete Graphs

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

Connected

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

Disconnected

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

Acyclic vs Cyclic

Acyclic Graph

An acyclic graph is a directed graph without cycles.A cycle is when a node can be traversed through and potentially end up back at itself.

Acyclic

Cyclic Graphs

A Cyclic graph is a graph that has cycles. A cycle is defined as a path of a positive length that starts and ends at the same vertex. cyc

Graph Representation

We represent graphs through:

mgraph

listGra

Weighted Graphs

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 WGra

WMGragh

WListGra

Traversals

Breadth First

breadth

Depth First

depth

depth2

Real World Uses of Graphs