You are on page 1of 45

Graphs

KOK BOON SHIONG JTP

A simple way to model connectedness is with a graph, which consists of nodes (vertices) joined by arcs (edges). A graph is called directed graph or digraph, if each edge of the graph G has a direction.

If each edge of the graph G has no direction then the graph is called un-directed graph.

A path is a trail with the restriction that no node is passed more than once. A closed trail is one with the initial and final nodes are the same.

A cycle is a closed trail where only the initial and final nodes are the same.

Graphs are allowed to have loops, connecting nodes to themselves. They may also have multiple arcs between pairs of nodes. A graph without loops and multiple arcs is called simple graph. 1 node 2 nodes
3 nodes

1 node 3 nodes Subgraph to

2 nodes

A graph in which each of the nodes is connected by precisely one arc to every other node is called a complete graph. The notation kn is used for the complete graph with n nodes.

Complete Graph

Cycles

Subgraph

Walk, Path and Circuit

Walk, Path and Circuit

Walk, Path and Circuit

Walk, Path and Circuit

Walk, Path and Circuit

Hamiltonian Graphs

Hamiltonian Graph

Hamiltonian Graph

Try This

Konigsberg Bridge Problem: How can you take a walk so that you cross each of our seven bridges once and only once and end up where you started?

Euler Circuits: Let the land area be represented as points (sometimes called vertices or nodes), and let the bridges be represented by arcs or line segments (sometimes called edges) connecting the given points. Diagram b called networks or graphs. In a network, the points where the line segments meet (or cross) are called vertices, and the lines representing bridges are called edges or arcs. Each separated part of the plane formed by a network is called a region. We say that a graph is connected if there is at least one path between each pair of vertices. A trail is a sequence of arcs such that the end node of one arc is the start node of the next.

Adjacency Matrix

Bipartite Graph

Bipartite graphs have two sets of nodes. The arcs only connect nodes from one set to the other, and do not connect nodes within a set. If, in a bipartite graph, every node in one set is connected to every node in the other set, the graph is called a complete bipartite graph. If there are r nodes in one set, and s nodes in the other, the complete bipartite graph is denoted by Kr, s.

You might also like