- DCN Tutorial
- Data Comm & Networks Home
- DCN - Overview
- DCN - Computer Network Types
- DCN - Network LAN Technologies
- DCN - Computer Network Topologies
- DCN - Computer Network Models
- DCN - Computer Network Security

- Physical Layer
- DCN - Physical Layer Introduction
- DCN - Digital Transmission
- DCN - Analog Transmission
- DCN - Transmission media
- DCN - Wireless Transmission
- DCN - Multiplexing
- DCN - Network Switching

- Data Link Layer
- DCN - Data Link Layer Introduction
- DCN - Error detection and Correction
- DCN - Data Link Control & Protocols

- Network Layer
- DCN - Network Layer Introduction
- DCN - Network Addressing
- DCN - Routing
- DCN - Internetworking
- DCN - Network Layer Protocols

- Transport Layer
- DCN - Transport Layer Introduction
- DCN - Transmission Control Protocol
- DCN - User Datagram Protocol

- Application Layer
- DCN - Application Layer Introduction
- DCN - Client-Server Model
- DCN - Application Protocols
- DCN - Network Services

- DCN Useful Resources
- DCN - Quick Guide
- DCN - Useful Resources

# Directed Acyclic Graph (DAG)

## Definition

In computer science and mathematics, a directed acyclic graph (DAG) refers to a directed graph which has no directed cycles.

## Explanation

In graph theory, a graph refers to a set of vertices which are connected by lines called edges. In a directed graph or a digraph, each edge is associated with a direction from a start vertex to an end vertex. If we traverse along the direction of the edges and we find that no closed loops are formed along any path, we say that there are no directed cycles. The graph formed is a directed acyclic graph.

A DAG is always topologically ordered, i.e. for each edge in the graph, the start vertex of the edge occurs earlier in the sequence than the ending vertex of the edge.

## Example

In the above directed graph, if we find the paths from any node, say u, we will never find a path that come back to u. Hence, this is a DAG.

## Application Areas

Some of the main application areas of DAG are −

Routing in computer networks

Job scheduling

Data processing

Genealogy

Citation graphs

- Related Articles
- Longest Path in a Directed Acyclic Graph
- Shortest Path in a Directed Acyclic Graph
- C++ Program to Find SSSP (Single Source Shortest Path) in DAG (Directed Acyclic Graphs)
- C++ Program to Apply DFS to Perform the Topological Sorting of a Directed Acyclic Graph
- C++ Program to Generate a Random Directed Acyclic Graph DAC for a Given Number of Edges
- Tree or Connected acyclic graph
- Connectivity in a directed graph
- C++ Program to Check Whether Graph is DAG
- Detect Cycle in a Directed Graph
- Euler Circuit in a Directed Graph
- Program to reverse the directed graph in Python
- Python Program for Detect Cycle in a Directed Graph
- C++ Program to Check the Connectivity of Directed Graph Using BFS
- Check if a directed graph is connected or not in C++
- Check if a given directed graph is strongly connected in C++