Skip to content

asmitahase/planarity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Planarity is a puzzle based on the concept of Planar Graphs.

screenshot

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.

  1. Generate a set of random lines in a plane such that no two lines are parallel

geogebra 1

  1. Calculate the intersections of each pair of lines

geogebra 2

  1. Mark the intersection points as vertices and segments as edges of the graph

geogebra 3

geogebra 4

The vertices of the graph are then randomly shuffled maintaining the topology to get the final puzzle piece

GamePlay

  1. Player will be presented with a planer tangled graph at level 4 at the beginning
  2. Move the nodes with a pointing device to untangle the graph and reach the next level

TechStack

Contributors

License

This project is free and open-source under the GPL-3.0 License.