Skip to content

6892-2019/ncl-simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NCL Simulator

This webapp lets you draw and simulate Nondeterministic Constraint Logic graphs, which are directed graphs with edge weights of 1 (red) or 2 (blue) where every node of degree ≥3 has an incoming weight of ≥2 and (in this implementation) where every node of degree 2 has an incoming weight of ≥1.

This project was written by Ivan Tadeu Ferreira Antunes Filho during the 2019 MIT class 6.892: Algorithmic Lower Bounds: Fun with Hardness Proofs. It is a fork of Mindcraft, a mind-mapping tool for drawing directed graphs.

Usage

  • Shift + click to create a node.
  • Shift + drag to create edge.
  • Click on an edge and press C to change colors.
  • N or press the play button to enter NCL mode.
    • Helper mode (speech bubble) automatically highlights flippable edges.
    • Click on an edge and press R to flip (reflect) it.
  • Drag nodes to move them around
  • Drag the canvas to pan around
  • Scroll wheel to zoom in/out
  • Load/save graph in JSON format via the leftmost buttons

Development

To run the app locally, clone the repo and open the index.html file with a browser. You won't need internet access.

If you are using Chrome or Chromium, you will need to open the browser with the --allow-file-access-from-files flag; otherwise you will not be able to export the graph as a PNG image. (This a limitation of Chrome/Chromium.)

License

The main source code is under the MIT license. See the LICENSE.md file.

The source code is a fork of Mindcraft, which in turn is a fork of directed-graph-creator, both of which are under the same MIT license.

The current git repository also includes files that aren't covered by this license and belong to other projects. You can find them under the external/ folder.

To the authors and contributors of those projects, thanks.

Until my knowledge, these are their respective licenses:

d3

FileSaver

Javascript-Undo-Manager

JavaScript Canvas to Blob

AlertifyJS

ColorBrewer

FontAwesome