Planarity
A puzzle: Arrange the given graph such that the edges intersect only at the vertices
Repository Video ▶️Planarity
Planarity is a puzzle based on the concept of Planar Graphs.
Live at: asmitahase.github.io/planarity
Contents
Description
A planar graph is a graph that can be drawn on a 2D plane such that the edges intersect only at the vertices. The goal of the puzzle is to untangle the graph to reveal its planar nature.
Generating puzzle piece
The game uses John Tantalo's algorithm to generate planar graphs.
- Generate a set of random lines in a plane such that no two lines are parallel
- Calculate the intersections of each pair of lines
- Mark the intersection points as vertices and segments as edges of the graph
The vertices of the graph are then randomly shuffled maintaining the topology to get the final puzzle piece
GamePlay
- Player will be presented with a planer tangled graph at level 4 at the beginning
- Move the nodes with a pointing device to untangle the graph and reach the next level
TechStack
- jQuery for DOM manipulation
- Tailwind to rapidly build UI elements
- Graph.js to draw graphs on HTML canvas
Contributors
License
This project is free and open-source under the GPL-3.0 License.
Asmita Hase
Now with coloured edges!
November 14, 2021
Project created by Asmita Hase
October 28, 2021