Do in Javascript
//Perform breadth-first search from initial state, using defined”is_goal_state”
//and “find_successors” functions
//Returns: null if no goal state found
//Returns: object with two members, “actions” and “states”,where:
// actions: Sequence(Array) of action ids required to reach thegoal state from the initial state
// states: Sequence(Array) of states that are moved through,ending with the reached goal state (and EXCLUDING the initialstate)
// The actions and states arrays should both have the samelength.
function breadth_first_search(initial_state) {
var open = []; //See push()/pop() and unshift()/shift() tooperate like stack or queue
//https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
var closed = new Set();//https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
/***Your code for breadth-first search here***/
/*
Hint: In order to generate the solution path, you will need toaugment
the
PayPal Gateway not configured
PayPal Gateway not configured