IDA* algorithm implemented in Scala using functional programming
Project structure:
- src/main/scala/idastar/Edge structure which represents edge in graph
- src/main/scala/idastar/Graph structure which represents graph using adjacency list of vertices
- src/main/scala/idastar/IDAStar class implements algorithm IDA* on graph and list of heuristic values for vertices
- src/test/scala/idastar/IDAStarTest tests perfomed on algorithm to check its correctness
To use IDA* algorithm call: IDAStar(graph, heuristicVerticesList).IDAStar(firstVertex)
where:
- graph - is idastar.Graph, graph constructed as adjacency list
- heuristicVerticesList - is Stream of heuristic values for vertices in graph
- firstVertex - index of first vertex from which searching will start
As a result you'll receive tuple of 3 elements:
- _.1 = length: Double - length of the found path, 0 if not found
- _.2 = path: Stream[Int] - found path as a stream, empty if not found
- _.3 = found: Boolean - variable informs if found solution, false if not found
Use index.html to check documentation of the project