Utility Methods
Add Node

Inserting a node in a directed graph is a constant time operation, typically O(1), as it involves creating a new vertex.

Add Edge

Deleting a node in a directed graph requires updating adjacency lists and removing connected edges. The time complexity is O(d + e), where d is the out-degree of the node and e is the total number of edges.

Delete Node

Inserting an edge involves updating the outgoing edges of the source node, resulting in a time complexity of O(1).

Delete Edge

Deleting an edge in a directed graph is a constant time operation, typically O(1), as it involves removing the directed connection between two nodes.

Directed Graph Search
Depth First

Depth-First Search (DFS) is a graph traversal algorithm that explores as far as possible along each branch before backtracking. It starts at an initial node, visits adjacent nodes, and continues deeper until it reaches a leaf node. Then, it backtracks and explores other branches. DFS has a time complexity of O(V + E), where V is the number of vertices and E is the number of edges in the graph.

Breadth First

Breadth-First Search (BFS) is a graph traversal algorithm that systematically explores all the vertices at the current level before moving on to the next level. Starting from an initial node, BFS visits its neighbors, then the neighbors' neighbors, and so on, until all reachable nodes are visited. The time complexity of BFS is O(V + E), where V is the number of vertices, and E is the number of edges in the graph.