Catch all Pokemon in given graph. Assignment number 2 in OOP class. Helping Professor Boaz catch all of the pokemon on the graph
There are 2 options in order to run the program. One option is to run the program normaly and then input the ID and Scenario. The second option is to run the program through the cmd and input the ID and Scenario in the number after the JAR name, that way the jar opened window will close when the scenario time runs out.
- Go to folder
E:\Git\Pokemon_game\out\artifacts\Ex2_jar\
- Run
java -jar Ex2.jar
- In the window you have the option to input the: * ID to run with * Scenario to use
- Then press the start button
- View the game run on the left side of the divider
- The score for the scenario will be shown top left corner where the timer was
- Go to folder
E:\Git\Pokemon_game\out\artifacts\Ex2_jar\
- Run
java -jar Ex2.jar {USER_ID} {SCENARIO_NUMBER}
- View the game run on the left side of the divider
- The scenario will finish running and will save the result in the server.
This platforme is based on a directed connected graph, the algorithm's used to check the graph for three things:
- SCC, strongly connected components
- Shortest Path Distance, the shortest path from node to node
- Shortest Path, the path to take to get from one node to the other
Two algorithms are used in the program.
- Tarjan - check SCC
- Dijkstra - find the shortest path by distance
This algorithm check the graph for shortest path from one node to the other, by putting them into a priority queue ordered according to distance, or 'weight', of the path to the node. Then moving on the graph according to the order of the queue.
This algorithm uses Depth-First Search , but with a quirk. When a algorithm visits a node it adds it to a stack, when it visits the starting node it unloads the stack and counts it as an SCC, and adds all of the unloaded nodes into a list of lists of SCC nodes.
For the inner workings visit the wiki.