Coder Social home page Coder Social logo

joshuaguerin / answer-set-programming-algorithms Goto Github PK

View Code? Open in Web Editor NEW
14.0 14.0 0.0 2.58 MB

Implementation of classical problems in Computer Science in the Answer Set Solving dialect of Clingo.

Python 100.00%
algorithm algorithms answer-set-programming clingo computer-science constraint-programming constraint-satisfaction-problem education language logic logic-programming np-complete np-hard

answer-set-programming-algorithms's People

Contributors

joshuaguerin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

answer-set-programming-algorithms's Issues

Add algorithm: N-Queens

It feels a bit obvious, but I think that is the curse of knowledge. Queens is so common because it is a great illustration. Probably going to add.

Clean up partial solutions

We are starting to get occasional traffic and stargazers, so let's clean things up and make them presentable.

Going to pull partial/non-working solutions into their own branches to keep the main page clean.

Major fixes: Clustering

Algorithm is highly inefficient and likely broken. Need to circle back to examine overall representation/strategy and correctness.

Minor fix: Sudoku (redesign grid constraint)

Current grid constraint is ugly and not terribly elegant. I think a solution is to be had that involves div or mod that greatly reduces the complexity of the final 2 constraints.

Add algorithm: Sudoku

At the start I've avoided puzzles, but they are likely to carry useful lessons for the reader. Sudoku is one of the standard examples.

Make pages more useful: problem descriptions

Current problem list:

  • Bin Packing
  • Clique
  • Clustering
  • Dominating Set
  • Equal Sum Partition
  • Graph Coloring
  • Independent Set
  • Knapsack
  • Max Flow
  • N Queens
  • Numerical 3-Dimensional Matching
  • Perfect Numbers
  • Prime Sieve
  • Subset Sum
  • Sudoku
  • Travelling Salesman
  • Vertex Cover
  • Wolf, Goat, and Cabbage

Consolidate printing/testing functionality

Create a shared scripting directory that includes (minimally) more generalized parsing functionality. This is shared among all instances, so this will go a long way to clean up individual code files and improve the ease of writing new Python source.

Add printers.

A couple of the algorithms have pretty-printers in the validate directory. Should look into doing so for more algorithms.

Current problem list:

  • Bin Packing
  • Clique
  • Clustering
  • Dominating Set
  • Equal Sum Partition
  • Graph Coloring
  • Independent Set
  • Knapsack
  • Max Flow
  • N Queens
  • Numerical 3-Dimensional Matching
  • Perfect Numbers
  • Prime Sieve
  • Subset Sum
  • Sudoku
  • Travelling Salesman
  • Vertex Cover
  • Wolf, Goat, and Cabbage

Minor fix: Queens (redesign diagonal constraint if possible)

Is it correct?
Can I make it better looking?

Not 100% certain on that last one. Two thoughts:

  1. I think two constraints are needed.
  2. The same arithmetic has to be expressed somehow.

I think we may be closing rapidly in on minimizing the ugly here.

Locate crashing printers, fix.

Initial solution for W-G-C problem printer had crashing upon unsat. Need to locate any similarly misbehaving scripts and fix for user friendliness.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.