# Project Assignment The goal of this assignment is to give students...

## Solution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

import java.io.*;
import java.util.*;

/*
* Java Project
* Implementation of Two Heuristic Algorithms to perform Graph Search
*/
public class Project {

// Main method for program execution
public static void main(String[] args) {
Scanner s = new Scanner(System.in);

// Query user for start node
System.out.print("Enter start node: ");
String start = s.nextLine();

// Check if start node is valid
if (!Graph.hasVertex(start)) {
System.out.println("Error: Invalid start node " + start);
return;
}

// Perform Algorithm 1 search
Algorithm1.search(start, "Z");

// Perform Algorithm 2 search
Algorithm2.search(start, "Z");
}

}

/*
* Graph class
*/
class Graph {

static ArrayList<String> vertices;
static int[][] weights;
static int[] dd;

// Method to load graph vertices and direct distances
}

// Method to load graph vertices
int rowNum = -1;
for(String line; (line = br.readLine()) != null; ) {
String[] params = line.split("\\s+");
if (rowNum == -1) {
vertices = new ArrayList<String>();
for (int i = 1; i < params.length; i++) {
}
weights = new int[vertices.size()][vertices.size()];
} else {
for (int colNum = 1; colNum < params.length; colNum++) {
weights[rowNum][colNum-1] = Integer.parseInt(params[colNum]);
}
}
rowNum++;
}

} catch (IOException e) {
e.printStackTrace();
}
}

// Method to load direct distances
dd = new int[vertices.size()];
int rowNum = 0;
for(String line; (line = br.readLine()) != null; ) {
String[] params = line.split("\\s+");
dd[rowNum] = Integer.parseInt(params[1]);
rowNum...

By purchasing this solution you'll be able to access the following files:
Solution.docx and Solution.zip.

\$75.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

### Find A Tutor

View available Data Structures and Algorithms Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.