Skip to content

A library for defining, manipulating, scrambling, and solving arbitrary twisty puzzles using graph-theoretic and group-theoretic abstractions.

Notifications You must be signed in to change notification settings

pnotequalnp/rubiks.idr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rubiks.idr

A library for defining, manipulating, scrambling, and solving arbitrary twisty puzzles using graph-theoretic and group-theoretic abstractions.

Design

Standard twisty puzzles can be modeled as groups. With this model, metrics can be represented as subsets of these groups. A Cayley graph is a colored graph which can be constructed from a group and any generating set of that group. Finding a path to the identity element on the Cayley graph generated by a twisty puzzle and a metric corresponds to solving that puzzle, with the color of the edges in the path corresponding to the solution.

Graphs

Data.Graph provides an interface representing a colored graph as a function from a node to its neighbors along with the color of the edge traversed. It also provides generic algorithms for searching graphs. Depth-first search (DFS) and iterative deepening depth-first search (IDS) both take an optional argument to prune the search tree by providing a lower bounding function. When provided a lower bound, IDS becomes Iterative deepening A* (IDA*).

Data.Graph.Cayley provides a generic implementation of the Cayley graph for a group and a generating set.

Groups

Data.Group provides a group interface and an interface for representing generating sets, along with many generic or trivial implementations of both.

Data.Group.Permutation provides an interface for permutation groups, along with two concrete representations: a list of cycles, and a permutation vector.

Data.Group.Cyclic provides an implementation of cyclic groups.

Usage

TODO

About

A library for defining, manipulating, scrambling, and solving arbitrary twisty puzzles using graph-theoretic and group-theoretic abstractions.

Resources

Stars

Watchers

Forks