Category: Graphs


Max Flow Problem – Ford-Fulkerson Algorithm

Objective: Given a directed graph which represents a flow network involving source(S) vertex and Sink (T) vertex.  Each edge in the graph has an individual capacity which is the maximum flow that edge allows....


Find the nearest building which has bike | Find nearest specific vertex from source in a graph.

Objective: Given a matrix (NxN) which represents the buildings in community. You are in a building and you need a bike to travel.  There are few buildings in community which has bikes which you...


Dijkstra Algorithm Implementation – TreeSet and Pair Class

Earlier we have seen what Dijkstra algorithm is is and how it works. In this article we will see its implementation using adjacency list and TreeSet. Example: Implementation – Adjacency List and Priority Queue...


Dijkstra’s – Shortest Path Algorithm (SPT) – Adjacency List and Min Heap – Java Implementation

Earlier we have seen the basics of Dijkstra algorithm. In this article we will see its implementation using adjacency list and Min Heap. We strongly recommend reading the following articles Dijkstra algorithm and how...


Prim’s – Minimum Spanning Tree (MST) |using Adjacency List and Priority Queue without decrease key in O(ElogV)

Earlier we have seen the implementation of prim’s algorithm using priority queue with decrease key and how decrease key has increased the time complexity. In this article we will improve the implementation(without decrease key)...

%d bloggers like this: