Skip to content

benmandrew/rose

Repository files navigation

Rose

Visualiser for Solitaire game graphs. You can interact with it online here.

Screenshot

Run with Docker

Set the timeout to whatever you wish; the performance of the webpage is proportional to the graph size, so if it's too slow, drop this lower to get a smaller graph.

BFS_TIMEOUT_S=0.1 docker compose up

Access the web app on http://localhost:8080.

By default, the graph will be explored by a breadth-first search (BFS) until the timeout. Alternatively, by setting WITH_DFS=true as below, it will first explore down a single path, depth-first, using a simple heuristic for the best move in each state. Once no more moves can be made, the BFS is done from every node in the path. Using this heuristic makes it possible to find the winning state, which will be labelled if found.

WITH_DFS=true BFS_TIMEOUT_S=0.1 docker compose up

Search algorithm

Set ALGORITHM to choose how the graph is explored (within the same depth/timeout budget):

  • bfs (default) — breadth-first search; explores every state level by level.
  • bestfirst — greedy best-first search ordered by a state heuristic (foundation progress, face-down cards, blocked cards, and free columns), biasing exploration toward promising states.
  • astar — A* search ordered by depth plus an admissible foundation-distance heuristic, reaching winning states along shorter paths first.
ALGORITHM=astar BFS_TIMEOUT_S=0.1 docker compose up

WITH_DFS=true takes precedence over ALGORITHM. All three algorithms build the complete state graph for visualisation; they differ only in which states they expand first when the budget is limited.

Build locally

Depends on:

  • cmake
  • npm

Build

$ mkdir build
$ cd build
$ cmake ..
$ cmake --build .

Run Tests

cmake --build . --target tests

Lint

cmake --build . --target lint

(Requires cpplint and cppcheck.)

Format

cmake --build . --target format

(Requires clang-format.)

About

Visualiser for Solitaire game graphs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors