International Journal of Computer Applications |
Foundation of Computer Science (FCS), NY, USA |
Volume 104 - Number 9 |
Year of Publication: 2014 |
Authors: Ankit Malhotra, Dipit Malhotra, Saksham Kashyap |
10.5120/18234-9217 |
Ankit Malhotra, Dipit Malhotra, Saksham Kashyap . Optimized Proposed Algorithm for Graph Traversal. International Journal of Computer Applications. 104, 9 ( October 2014), 38-43. DOI=10.5120/18234-9217
This paper includes a flexible algorithm for traversing a directed and an undirected graph. Graph traversal is defined as the problem of visiting all the nodes in a graph in a particular manner, updating and/or checking their values along the way. The Breadth first search along with Depth first search are the most widely used algorithms for traversing a graph. In this article, an algorithm is proposed for traversing a graph taking in consideration the vertex with the maximum outgoing edges. Instead of beginning from the root node and then gaining access to visit the neighbors of the currently visited node, the algorithms looks for the vertex with the maximum edges and then continue traversing all the neighboring vertices of that vertex. This paper presents an algorithm to traverse an undirected or a directed graph and calculates the time and space complexity of the algorithm. The work proposed here intends to find a new algorithm that can be universally applied to all types of graphs