# Java Programming Examples on Graph Problems & Algorithms

## 1. Java Programming examples on “Connected Components”

The section contains programs that solve linear equations, check foe connectivity of directed and undirected graphs using DFS and BFS algorithms, graph traversals, testing if directed and undirected graphs are trees and implementation of kosaraju, tarjan and gabow algorithms.

## 2. Java Programming examples on “Topological Sorting”

The programs in this section perform topological sort using DFS and checks for cycles in graphs, generates a random linear extension for DAG and generates all such possible linear extensions.

## 3. Java Programming examples on “Minimum Spanning Tree”

The programs in this section perform implementations on Prim, Kruskal, Boruvka and Delaunay triangulation algorithms.

Java Program to Apply the Prim’s Algorithm to Find the Minimum Spanning Tree of a Graph Java Program to Apply the Kruskal’s Algorithm to Find the Minimum Spanning Tree of a Graph Java Program to Use Boruvka’s Algorithm to Find the Minimum Spanning Tree Java Program to Create a MST of a Set of Points Spread in Two Dimensions Using Delaunay Triangulation Java Program to Give an Efficient Algorithm to Compute the Second-Best Minimum Spanning Tree of G |

## 4. Java Programming examples on “Shortest Path”

The programs find the shortest path between two vertices using dijkstra’s algorithm, bellman-ford algorithm, topological sorting, floyd-warshall algorithm, and implements dijkstra algorithm using queue, heap and set and also performs implementation of bellmanford, floyd warshall and johnson’s algorithm.

## 5. Java Programming examples on “Transitive Closure and Reduction”

The programs in this section computes the transitive closure of a graph using warshall-algorithm and evaluates the transpose of a graph matrix.

Java Program to Find the Transitive Closure of a Given Graph G Java Program to Construct Transitive Closure Using Warshall’s Algorithm Java Program to Find Transpose of a Graph Matrix |

## 6. Java Programming examples on “Matching”

The programs in this section solves for matching problems using hungarian algorithm, edmond algorithm and hopcroft algorithm.

Java Program to Solve a Matching Problem for a Given Specific Case Java Program to Rearrange Letters of a String such that no More than 1 Letters should Retain the Same Position Java Program to Solve a Matching Problem for a Given Specific Case Java Program to Implement the Hungarian Algorithm for Bipartite Matching Java Program to Implement the Edmond’s Algorithm for Maximum Cardinality Matching Java Program to Solve a Matching Problem for a Given Specific Case Java Program to Implement Hopcroft Algorithm |

## 7. Java Programming examples on “Eulerian Cycle/Chinese Postman”

The programs in this section checks if directed and undirected graphs contain eulerian cycle and path and performs implementation of euler circuit problem and chinese postman problem.

## 8. Java Programming examples on “Edge and Vertex Connectivity”

The programs determine if the graph is weakly connected or strongly connected and also tests for edge connectivity and vertex connectivity of graphs.

## 9. Java Programming examples on “Drawing Trees”

The programs in this section performs insertion, deletion, searching operations on a binary tree, constructs tree for different types of expressions like infix, prefix and postfix and performs respective inorder, preorder and postorder traversals for a tree with recursion and without recursion. The other programs carry left and right rotation operations on binary tree, checks if the given tree is AVL and implements different types of trees like segment, interval, range, ternary, binary, cartesian, AA, AVL and spaly trees. The programs also carry out implementation of types of trees like tango, threaded, suffix, red black, scape goat, ternary search, expression and fenwick tree.

## 10. Java Programming examples on “Planarity Detection and Embedding”

The section contains programs that implement hopcroft, planar, booth and leuker algorithms and check for planarity of graphs.

Java Program to Check Whether a Graph is Planar or Not Java Program to Implement the Hopcroft and Tarjan Algorithm Java Program to Implement the Booth and Lueker Algorithm to Check for Planarity |

## 11. Java Programming examples on “Graph Search”

The programs in this section implement BFS and DFS algorithms, evaluates forward, cross and back edges in a garaph and checks if the graph is bipartite or not.

## 12. Java Programming examples on “Others”

The programs in this section represent a graph using adjacency list and matrix, incidence list and matrix and implements miscellaneous other algorithms like ford fulkerson, max flow min cut, word wrap problem, network flow problem, graph coloring algorithm and hamiltonian cycle algorithm.

**Here’s the list of 1000 Java Algorithms, Problems & Programming Examples.**