Hipster: An Open Source Java Library for Heuristic Search Pablo Rodríguez-Mier, Adrián González-Sieira, Manuel Mucientes, Manuel Lama, Alberto Bugarín. Centro Singular de Investigación en Tecnoloxías da Información Universidade de Santiago de Compostela 16 de junio de 2014 citius.usc.es
28
Embed
Hipster: An Open Source Java Library for Heuristic Search
We present Hipster: a free, open source Java library for heuristic search algorithms. The motivation of developing Hipster is the lack of standard Java search libraries with an extensible, flexible, simple to use model. Moreover, most of the libraries for search algorithms rely on recursive implementations which do not offer fine-grained control over the algorithm. Hipster provides a wide variety of classical search algorithms implemented in an iterative way like Dijkstra, A*, IDA*, AD* and more. In order to facilitate the use and integration with most research, commercial and non-commercial projects, the software is developed under the open source Apache 2.0 License. Hipster was successfully applied in two different research projects in the areas of Web service composition and motion planning. Source code, documentation, binaries and examples can be found at https://github.com/citiususc/hipster.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Hipster: An Open Source Java
Library for Heuristic Search
Pablo Rodríguez-Mier, Adrián González-Sieira, Manuel Mucientes,
Manuel Lama, Alberto Bugarín.
Centro Singular de Investigación en Tecnoloxías da Información
Universidade de Santiago de Compostela
16 de junio de 2014citius.usc.es
Problem Solving as State Space Search - I
Many AI problems can be formulated as State Space Search.
We have a problem and we need to find a solution:
. Where do we start from?
. What is the solution of the problem?
. How can we assess the quality of a solution of a problem?
. Which actions or steps can we take in order to solve it?
. How can we estimate how far we are from the solution during the
search?
Examples:
16 de junio de 2014 1/26
Problem Solving as State Space Search - II
In a nutshell, a state space search problem is defined in terms of states,
actions and transitions.
States: representation of a particular configuration of our problem.
. Initial state: where we start searching from.
. Goal state: state which represents a valid solution.
Actions: description of the possible actions or movements that we
can do from a given state.
Transitions: describe how actions lead from one given state to a
different state.
The solution to a problem is the sequence of actions that lead from the
initial state to the goal state.
16 de junio de 2014 2/26
8-Puzzle game example - Step 1
16 de junio de 2014 3/26
8-Puzzle game example - Step 2
16 de junio de 2014 4/26
8-Puzzle game example - Step 3
16 de junio de 2014 5/26
8-Puzzle game example - Step 4
16 de junio de 2014 6/26
8-Puzzle game example - Step 5
16 de junio de 2014 7/26
8-Puzzle game example - Step 6
16 de junio de 2014 8/26
Motivation - I
Why did we create Hipster?
There is an important lack of standard implementations of
algorithms in Java.
Most implementations are neither extensible nor flexible:
. The search process cannot be controlled.
. Costs are usually floats or doubles, there is no way to use complex
custom costs.
. There is no way to handle more than one single goal.
. ...
Graph specific libraries are not always suitable for problem solving!
16 de junio de 2014 9/26
Motivation - II
Project Goals
Iterative algorithms.
. while(search.hasNext()) search.next();
Flexible, extensible, reusable.
. Hipster.createAStar(problem).search(goal);
. Hipster.createIDA(problem).search(goal);
Powerful, simple, strong-typed API.
. Generic types→ compile-time type safety.
. Builders to assist the specification of search problems.
Highly-tested code.
. Unit tests, continuous integration in the cloud.
Open-Source.
. Permissive Apache 2.0 (GPL compatible) license.
16 de junio de 2014 10/26
Currently implemented algorithms
Uninformed search (no heuristics)
. Depth First Search (DFS)
. Breadth First Search (BFS)
. Dijkstra’s algorithm
. Bellman-Ford
Informed search
. A* algorithm
. Iterative Deepening A* (IDA*)
. Anytime Dynamic A* (AD*)
Local search
. Hill-climbing.
. Enforced Hill-climbing.
16 de junio de 2014 11/26
Solving 8-Puzzle with Hipster
8-Puzzle state space formulation example
States: 8-Puzzle represented as an array of numbers.
Actions: movements of the empty tile (RIGHT, LEFT, UP, DOWN).
Transitions: state × action→ state’ (board with the tiles swapped).
. Example: {5,4,0,7,2,6,8,1,3} × LEFT = {5,0,4,7,2,6,8,1,3}
Solution: minimal sequence of actions from initial to goal
16 de junio de 2014 12/26
Solving 8-Puzzle with Hipster - Step 1
16 de junio de 2014 13/26
Solving 8-Puzzle with Hipster - Step 2
16 de junio de 2014 14/26
Solving 8-Puzzle with Hipster - Step 3
16 de junio de 2014 15/26
Solving 8-Puzzle with Hipster - Step 4
16 de junio de 2014 16/26
Solving 8-Puzzle with Hipster - Step 5
16 de junio de 2014 17/26
Solving 8-Puzzle with Hipster - Step 6
16 de junio de 2014 18/26
Solving 8-Puzzle with Hipster - Step 7
16 de junio de 2014 19/26
Solving 8-Puzzle with Hipster - Step 8
Finally, we select an algorithm to perform the search until the goal state