Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

/* * Copyright 2017 Marc Liberatore. * Modified 2018 David Wemhoener. */ package search; import java.util.Set; import java.util.List; /** * An implementation of a Searcher

/*

* Copyright 2017 Marc Liberatore.

* Modified 2018 David Wemhoener.

*/

package search;

import java.util.Set;

import java.util.List;

/**

* An implementation of a Searcher that performs an iterative search,

* storing the list of next states in a Queue. This results in a

* breadth-first search.

*

* @author liberato

*

* @param the type for each vertex in the search graph

*/

public class Searcher {

private final SearchProblem searchProblem;

/**

* Instantiates a searcher.

*

* @param searchProblem

* the search problem for which this searcher will find and

* validate solutions

*/

public Searcher(SearchProblem searchProblem) {

this.searchProblem = searchProblem;

}

/**

* Finds and return a solution to the problem, consisting of a list of

* states.

*

* The list should start with the initial state of the underlying problem.

* Then, it should have one or more additional states. Each state should be

* a successor of its predecessor. The last state should be a goal state of

* the underlying problem.

*

* If there is no solution, then this method should return an empty list.

*

* @return a solution to the problem (or an empty list)

*/

public List findSolution() {

// TODO

return null;

}

/**

* Determines what states are reachable from the start state in a

* certain number of moves

*

* @param m the number of moves from the start state

* @return a set of nodes

*/

public Set findReachableSet(int m) {

// TODO

return null;

}

/**

* Checks that a solution is valid.

*

* A valid solution consists of a list of states. The list should start with

* the initial state of the underlying problem. Then, it should have one or

* more additional states. Each state should be a successor of its

* predecessor. The last state should be a goal state of the underlying

* problem.

*

* @param solution

* @return true iff this solution is a valid solution

* @throws NullPointerException

* if solution is null

*/

public final boolean isValidSolution(List solution) {

// TODO

return false;

}

}

***************************************

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke

4th Edition

0136086535, 9780136086536

More Books

Students also viewed these Databases questions

Question

17 Develop, implement, and evaluate succession planning process.

Answered: 1 week ago

Question

Define Management by exception

Answered: 1 week ago

Question

Explain the importance of staffing in business organisations

Answered: 1 week ago

Question

What are the types of forms of communication ?

Answered: 1 week ago

Question

Explain the process of MBO

Answered: 1 week ago

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago