Question
Write a Java Program that does the following: Generate a graph with 100,000 nodes, where each node randomly has between 1 and 5 connections to
Write a Java Program that does the following:
Generate a graph with 100,000 nodes, where each node randomly has between 1 and 5 connections to other nodes.
Each node should contain within it a value between 1 and 300,000. (So generally about 1 in 3 searches will yield a query match)
Allow the user to enter a number to search for, and choose from the following three types of searching algorithms to utilize as the search routine.
Breadth-First.
Depth-First.
Dijkstra's Algorithm.
Do not allow back-tracking in your searches. (Mark nodes that you already searched as complete, and do not re-visit them in the same search)
Each search should return the following:
The Success/Failure of your search.
The length of the shortest path to the found node.
The total number of nodes examined during the search.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started