Module I Automata Theory and Formal Languages - Lesson 2: Relations and Graphs
Fundamental Concepts of Relations
A binary relation is categorized as a set of pairs.
The structure of a relation involves two primary components:
Domain: This is the set from which the first component of each pair in the relation is chosen.
Range: This is the set from which the second component of each pair in the relation is chosen.
Formal Definition:
Let and be non-empty sets.
A relation from to is defined as a subset of the Cartesian product .
This is mathematically expressed as .
In this specific context, serves as the domain and serves as the range.
Notation of Membership:
If and the pair is an element of (), the relationship is written as .
If the pair is not an element of the relation, it is noted that is not related to .
Relations on a Single Set:
It is frequent for the sets and to be equal ().
When , it is referred to as a relation on .
Mathematical Examples of Relations
Example 1: The "Less Than" Relation:
Consider sets and .
Define the relation (less than) on such that if and only if a < b.
The resulting set is: .
Logic: In the pair , represents elements in set and represents elements in set . For instance, is valid because (from set ) is less than (from set ). This logic applies to every element in the set .
Example 2: The "Multiple Of" Relation:
Let .
Define the relation such that if and only if is a multiple of .
The resulting set is: .
Mathematical Symbols and Notation Summary
: Denotes a set.
: Denotes a subset.
: Denotes a Cartesian product.
: Denotes a relation.
: Denotes "is an element of."
: Denotes a graph.
Theory of Undirected Graphs
An undirected graph (referred to simply as a graph) is denoted by .
Components of a Graph:
Nodes or Vertices (V): These are the points within the graph.
Edges (E): These are the lines that connect specific pairs of points.
Node Degree in Undirected Graphs:
The degree of a node is defined as the total number of edges connected to that particular node.
The order of vertices in an edge pair does not matter in an undirected graph (i.e., the pair is equivalent to ).
Formal Description Examples:
Example Graph 1:
Description: .
Analysis: Every node has a degree of 2. Node 1 has edges to nodes 2 and 3; node 2 has edges to nodes 1 and 3; and node 3 has edges to nodes 1 and 2.
Example Graph 2:
Description: .
Analysis: Nodes 1 and 4 possess a degree of 3. Nodes 2 and 3 possess a degree of 2.
Theory of Directed Graphs (Digraphs)
A graph that utilizes arrows instead of simple lines to indicate direction is known as a directed graph, or digraph.
Formal Definition of a Digraph:
A digraph is denoted as .
It consists of a finite set of vertices .
It contains a set of ordered pairs of vertices called edges .
Degrees in Directed Graphs:
Outdegree: The total number of arrows (edges) pointing away from a specific node.
Indegree: The total number of arrows (edges) pointing toward a specific node.
Digraph Example 1:
Formal Description: .
Data points: The outdegree of node 5 is 1. The indegree of node 4 is 2.
Digraph Example 2: Relation to Digraph Mapping:
Let sets and .
Let the relation be defined as: .
This relation can be represented as a digraph where each ordered pair in constitutes a directed edge from the first element to the second element.