Giter Site home page Giter Site logo

csplib / csplib Goto Github PK

View Code? Open in Web Editor NEW
81.0 81.0 65.0 158.38 MB

A benchmark library for constraints

Home Page: csplib.org

TeX 11.42% Makefile 0.12% Prolog 24.62% Common Lisp 5.49% C 0.70% C++ 7.17% HTML 7.35% Scala 2.77% C# 2.86% Java 7.35% Python 22.16% Perl 0.13% Shell 0.60% JavaScript 0.12% CSS 1.05% Batchfile 0.13% AMPL 2.14% R 3.81% Dockerfile 0.01% Emacs Lisp 0.01%

csplib's Introduction

License CC BY 4.0 Build Status

Requires Python 3.3+, (Python 3.4+ on windows).

csplib does not work with Python 3.9 or above. If you have trouble running csplib, try 'make docker' instead of 'make'.

To build a local copy of csplib to view locally type:

make        # Builds CSPLib to the _deploy directory
make serve  # Starts a local web server to view the files
<open localhost:8000 in your browser>

To add a new problem use new_problem.sh to create a basic outline.

See HOWTO.md for detailed instructions.

Problem Specification

Each problem is stored in the Problems directory. The best way to get a feeling for how a problem is stored is to look at an existing problem (Problem/prob001 is a good start).

Each problem is built from the following parts:

  • specification.md - The basic description of the problem. This will contain a title, proposer, category, and an English description of the problem. This is technically all that is required.

  • references - This directory contains the references, usually in references.bib file as bibtex.

  • models, data and results - The models, data and results directories store models of the problem, data files and any known results. The exact structure of these is described below.

The assets/ directory will be copied but not automatically linked to. Use this directory for files, such as images, which are linked to from specification.md

specification.md

The specification needs to start with a Title, Proposer and Category in the following format:

---
Title:    Magic Hexagon
Proposer: Toby Walsh
Category:
    - Design and configuration
    - Combinatorial mathematics
    - Games and puzzles
---

If the Proposer or Category have multiple values, they are put on a new line as shown above.

The rest of the specification is written in markdown. References from the references section can be cited using the notation cite{bibref}.

References

References are stored in the references directory. The file references.bib should contain references in standard BibTeX format. Any text in the file notes.inline.md will be listed at the top of the references page.

A problem can be referenced using its id, [prob058] will be shown hyperlinked as [prob058]. {prob058} will shown hyperlinked as Discrete Lot Sizing Problem

Languages can also be referenced e.g. [Minion]

Models, data and results directories

Each of these directories are handled in the same way.

Files can be added to these directories by simply placing the file in the appropriate directory. Human readable files are displayed in place, binary files are given a download link. If any file is incorrectly identified as binary or human readable, please submit a bug report!

You can describe a file file.txt in a file file.txt.metadata. This can contain a Title, and a Type. The file should be formatted as follows:

---
Title: This describes the data file
Type: The type
---

In general, Type is only useful for models and data.

You can also use files with the extension .inline.md which will be displayed inline directly in the results/references/model tab. See problem prob013 for an example of all these types of files.

Language Specification

Languages are stored in the Languages directory. Languages do not store the models, data and results, these are stored with the problems and linked from the languages.

specification.md for Languages

The specification of languages is similar to problems, with a simpler design. Languages should contain a title, and (single or list of) extensions:

---
Title: MiniZinc
Extensions:
    - mzn
    - minizinc
---

The extensions will be matched against the file extensions, or Type contained in all models, data and results of all problems.

Website building scripts

An overview of the architecture used to build csplib can be found at internal/readme.md.

csplib's People

Contributors

9thbit avatar andreina-francisco avatar arnaud-m avatar atm7 avatar bilalh avatar ccoffrin avatar cftmthomas avatar chrisjefferson avatar guidotack avatar hakank avatar hemmidavid avatar hsimonis avatar ianjmiguel avatar jnmonette avatar joanespasa avatar jschimpf avatar justinkennethpearson avatar lecoutre avatar lokdlok avatar ott2 avatar ozgurakgun avatar pesantgilles avatar pwn1 avatar qcappart avatar ratheilesse avatar siala avatar thmour avatar turingfan avatar vale1410 avatar wetterj avatar

Stargazers

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

Watchers

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

csplib's Issues

Cannot build the website because pip fails

Hello

I cannot build locally the website because pip fails with no such option --allow-external during make.
I have found this explanation.

Usage:   
  pip install [options] <requirement specifier> [package-index-options] ...
  pip install [options] -r <requirements file> [package-index-options] ...
  pip install [options] [-e] <vcs project url> ...
  pip install [options] [-e] <local project path> ...
  pip install [options] <archive url/path> ...

no such option: --allow-external
<<Finished>>
./internal/scripts/support/problem_creation_dates.sh
# activate virtual python environment
. ./internal/scripts/env/bin/activate && \
./internal/scripts/framework/generate_web_site.py

Here a a few information about my configuration.

$ uname -a 
Linux arrakis 5.13.9-200.fc34.x86_64 #1 SMP Sun Aug 8 14:34:00 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
$ python --version
Python 3.9.6

Thanks for your help.

041: The n-Fractions Puzzle

Hello,
Most of the models do not match the problem's specification.
They consider the fraction x_i/(y_i*z_i) instead of x_i/(10y_i + z_i).

Problem with markup-like syntax in data files

Hi,

I am not sure this can be easily fixed but the page "http://www.csplib.org/Problems/prob030/data/bacp10.dat.html" (and same for bacp8 and bacp12) does not properly show the content of the "prereq" array because it contains entries that look like "<dew101,dew100 >", which should be understood as a pair of courses but is parsed (as far as I can tell) as a markup tag without meaning and then not shown. (Note that I needed to escape the < to make it appear here)

As the behaviour might be browser specific, I should tell that I am using Firefox 42 on Linux Mint.

Best, JN

Feature Request: Blog or something with a better name

It would be nice to have a sensible place to put simple articles, e.g. one today thanking everybody and saying how awesome the CSP Lib Sprint was.

I don't like the word blog because it would imply to people that we might regularly update it, which is less likely. But it would be nice if there was somewhere to put this kind of thing.

AC-3 and numberjack

hi, i have to create a python program that solves some generic csp problem (for example #23 Magic Hexagon problem). The problem is that i have to use AC-3 algorithm and i don't know how i can do. I don't understand how merge the program with AC-3. I was thinking to use numberjack but i don't know how continue

a mysterious "fdsfds" on the website

When I go to the website now, I see a mysterious "fdsfds" on the top left. It is inside the <head> tag in the generated html source. When I look at the html template, I see it corresponds to something called {{meta_index}} (here). I have no idea why its value is "fdsfds" though.

Make fails if pip is not installed

Running make gives the following errors if pip is not installed:

$ make
# create virtual python Environment
./internal/scripts/support/setup.sh
Error: Command '['/home/viz/workspace/csplib/internal/scripts/env/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1
./internal/scripts/support/setup.sh: line 19: ./internal/scripts/env/bin/activate: No such file or directory
pip @ ./internal/scripts/support/setup.sh: line 23: pip: command not found
./internal/scripts/support/setup.sh: line 28: pip: command not found
<<Finished>>
./internal/scripts/support/problem_creation_dates.sh
# activate virtual python environment
. ./internal/scripts/env/bin/activate && \
    ./internal/scripts/framework/generate_web_site.py
/bin/sh: 1: .: Can't open ./internal/scripts/env/bin/activate
make: *** [build] Error 2

It's probably worth mentioning in README that pip is required.

csplib-builds

We have csplib builds of every branch at http://csplib.github.io/csplib-builds. Also the commits in csplib-builds references the commit in csplib that it build e.g. csplib/csplib-builds@e862e04

Some improvement which could be made:

  • Better index page
  • At the moment if a build is very slow and a newer build finishes first they would be committed in the wrong order
  • Add a link to http://csplib.github.io/csplib-builds on csplib?
  • make preview of pull requests
  • At the moment files are not deleted when a new build is made, leading to dangling files

Edge cases in SGP and PPP

SGP: Should 1 person groups be allowed. The specification doesn't explicitly say this, but I think it should.

PPP: Should a period without any guests be allowed. Again, the specification doesn't disallow this, but I think it should.

Thoughts?

Links to external encoders in Models

Currently, in the subsection Models we can add models as File/Type/Notes. I would like to be able to add a link to a website that contains a problem specific encoder.

For instance for prob001 car sequencing I have written a problem at github.com/vale1410/car-sequencing that is a parametrised encoder to CNF for SAT solving and I would like to add reference in the Models section.

Add make clean

make clean should remove _deploy and ./internal/scripts/env

How can I help list?

Collect a list of small outstanding tasks and curate those on the website, to help inspire would-be volunteers.

For example, the outstanding items from the Essence Catalog, and how to do a migration.

fix broken links

there are a bunch of links to non-existant websites. We should do an automated pass to look for broken links, and then probably archive.org as many as possible.

Organization on Github

Rather than having an account just for the csplib, would it make sense for Association for Constraint Programming to have an organization account (e.g. a4cp) and then make csplib and other repositories inside that account?

So it would be organized, a4cp/csplib?

Json Output

There is json output for problems by adding .json to the end of the url, this should linked somewhere.

bibtex does not protect capital letters

On http://csplib.org/Problems/prob056/cite/ , the title given in the bibtex is: "{CSPLib} Problem 056: Synchronous Optical Networking (SONET) Problem",. This protects the CSPLib with {}, but not the word SONET, so it will get put in lower case by bibtex.

I don't really want to tell uses they have to put bibtex style escapes in, so here is a suggested rule: When outputting bibtex, if a word has a capital letter in a location other than it's first letter, surround it in {}.

Prob012 - regular constraint type signature

Hi @hakank

I was unable to compile prob012/models/nonogram_automaton.co in Comet 3.0 (the version I have). Because the regular type signature in that version is,

Constraint<CP> regular(var<CP>{int}[] x, Automaton<CO> automaton)

In this model it is,

Constraint<CP> regular(var<CP>{int}[] x, Automaton<CP> automaton)

I don't know what the difference between the types Automaton<CO> and Automaton<CP> is, so I did not debug the issue further. Maybe you could double check that it works with a version of Comet 2.x?

prob001 data is incomplete

The data for the car sequencing problem is incomplete.
(https://github.com/csplib/csplib/blob/master/Problems/prob001/data/data.txt)

Some of them do not have the capacity and block variables set.

For problems pulled from the Regin and Puget CP97 paper I can find that they all have the same capacities: 1/2 for option 0, 2/3 for option 1, 1/3 for option 2, 2/5 for option 3, and 1/5 for option 4

But for some other problems that have this data missing I do not know where they came from.

List of authors/contributors would be nice

There is the authors page which is good. But it might be nice to have a list of contributors too, i.e. people who have contibuted to the git hub. Even if it is just to github usernames. To give credit to people who aren't problem proposers but have contributed.

Links to references be simply in numerical order?

It looks ugly and not-useful to have references to bibtex be just the tags, because they may be unhelpful.

Given that it would be hard to do fancy (Smith and Jones 1989), perhaps simply number in order they are in the bibtex file or something, e.g. just [1]. The link to the references bibtex is good so that could be the same.

Categories oddity

The categories page
screen shot 2014-05-20 at 01 24 36

prob002 from the categories page
screen shot 2014-05-20 at 01 25 26

Would be nice if it said CSPlib / Categories / prob002 but this would require passing state to all problem pages.

Syntax highlighting for E'

I checked in some rubbish highligheter very similar to the essence one. Could someone please connect that up.
Also the language seems to be called SavileRow, EssencePrime or Essence' in different files/directory names. can we standardise on EssencePrime everywhere?

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.