Giter VIP home page Giter VIP logo

mkoeppe / cutgeneratingfunctionology Goto Github PK

View Code? Open in Web Editor NEW
12.0 4.0 11.0 80.37 MB

Python code for computation and experimentation with cut-generating functions, in particular the Gomory-Johnson infinite group problem. By M. Köppe, Y. Zhou, C.Y. Hong, J. Wang with contributions by undergrad programmers

License: GNU General Public License v2.0

Makefile 0.37% Python 23.56% TeX 3.02% Shell 0.17% Jupyter Notebook 0.87% Emacs Lisp 0.01% Sage 71.99%
integer-programming mixed-integer-programming python sagemath cutting-planes

cutgeneratingfunctionology's Introduction

mkoeppe/cutgeneratingfunctionology: Python code for computation and experimentation with cut-generating functions

Most of the code is for the 1-dimensional Gomory-Johnson infinite group problem, including an electronic compendium of extreme functions.

See http://www.sagemath.org/doc/tutorial/ for information on how to use Sage.

Travis CI

License: GNU General Public License, version 2, or any later version as published by the Free Software Foundation.

PyPI package

Run it on mybinder.org

Sphinx documentation built

Twitter

Authors

See https://github.com/mkoeppe/cutgeneratingfunctionology/blob/master/AUTHORS.rst and also https://github.com/mkoeppe/cutgeneratingfunctionology/blob/master/THANKS.rst

License

The code is released under the GNU General Public License, version 2, or any later version as published by the Free Software Foundation.

Documentation

http://mkoeppe.github.io/cutgeneratingfunctionology/doc/html/

Using the cutgeneratingfunctionology package

There are many ways to run this package.

A. Run it online on mybinder.org

image

B. Install released version from PyPI and run it within conda

PyPI package

C. Clone from GitHub and run it within conda

D. Run in a standalone installation of the SageMath distribution (no conda)

cutgeneratingfunctionology's People

Contributors

jiawei-wang-ucd avatar jwg4 avatar mkoeppe avatar nicoleyueqili avatar pgxiao avatar yuan-zhou avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

cutgeneratingfunctionology's Issues

Branch facet_test_more_complete

Complete the work on this branch:

  • In simple cases, facet_test should be able to construct the lifting.
  • A version of the moves diagrams should be used for facet_test.
  • extremality_test, presented with a 2-sided discontinuous function, should by default raise a NotImplementedError if crazy perturbations might exist instead of just issuing a warning.

Make completion resume correctly after interruption

Currently we have the following when the extremality test is interrupted during the first moves diagram plot:

sage: h = bhk_irrational()
INFO: 2017-06-16 09:02:29,906 Coerced into real number field: Real Number Field in `a` as the root of the defining polynomial y^2 - 2 near 1.414213562373095?
INFO: 2017-06-16 09:02:29,909 Conditions for extremality are satisfied if it is a minimal function.
INFO: 2017-06-16 09:02:29,998 Coerced into real number field: Real Number Field in `a` as the root of the defining polynomial y^2 - 2 near 1.414213562373095?
sage: extremality_test(h, True)
INFO: 2017-06-16 09:02:34,933 pi(0) = 0
INFO: 2017-06-16 09:02:34,954 pi is subadditive.
INFO: 2017-06-16 09:02:34,955 pi is symmetric.
INFO: 2017-06-16 09:02:34,955 Thus pi is minimal.
INFO: 2017-06-16 09:02:34,955 Plotting 2d diagram...
INFO: 2017-06-16 09:02:34,955 Computing maximal additive faces...
INFO: 2017-06-16 09:02:35,110 Computing maximal additive faces... done
Launched png viewer for Graphics object consisting of 382 graphics primitives
INFO: 2017-06-16 09:02:38,268 Plotting 2d diagram... done
INFO: 2017-06-16 09:02:38,409 Plotting...
^C
KeyboardInterrupt
sage: extremality_test(h, True)
INFO: 2017-06-16 09:02:43,345 pi(0) = 0
INFO: 2017-06-16 09:02:43,345 pi is subadditive.
INFO: 2017-06-16 09:02:43,346 pi is symmetric.
INFO: 2017-06-16 09:02:43,346 Thus pi is minimal.
INFO: 2017-06-16 09:02:43,346 Plotting 2d diagram...
Launched png viewer for Graphics object consisting of 382 graphics primitives
INFO: 2017-06-16 09:02:46,514 Plotting 2d diagram... done
INFO: 2017-06-16 09:02:46,515 Plotting covered intervals...
Launched png viewer for Graphics object consisting of 38 graphics primitives
INFO: 2017-06-16 09:02:57,235 Plotting covered intervals... done
INFO: 2017-06-16 09:02:57,235 Uncovered intervals: ([<Int(0.3000000000000000?, 0.3500000000000000?)>, <Int(0.4500000000000000?, 0.50000000000000000?)>],)
INFO: 2017-06-16 09:02:57,362 Total: 9 stability orbits, lengths: ['8', '8', '8', '8', '8', '8', '8', '6', '2']
INFO: 2017-06-16 09:02:57,364 Plotting completion diagram with perturbation...
INFO: 2017-06-16 09:02:57,364 pi(0) = 0
INFO: 2017-06-16 09:02:57,364 pi is subadditive.
INFO: 2017-06-16 09:02:57,364 pi is symmetric.
INFO: 2017-06-16 09:02:57,364 Thus pi is minimal.
INFO: 2017-06-16 09:02:57,365 Uncovered intervals: ([<Int(0.3000000000000000?, 0.3500000000000000?)>, <Int(0.4500000000000000?, 0.50000000000000000?)>],)
INFO: 2017-06-16 09:02:57,367 Finding epsilon interval for perturbation...
INFO: 2017-06-16 09:02:57,371 Zero epsilon encountered for x = 0.1500000000000000?, y = 0.3250000000000000?
---------------------------------------------------------------------------
AssertionError: Epsilon should be positive, something is wrong

This is probably because any_change_moves is cleared too early.

add facet_test

... mostly delegating to extremality_test, but raising NotImplementedError for cases in which we don't have an algorithm

problem with limiting_slopes

Hi
There seems to be a bug in limiting_slopes:

sage: limiting_slopes(gmic(f=0.66666666))
INFO: 2016-08-01 16:20:58,542 Rational case.
(50000000/33333333, -Infinity)
sage: limiting_slopes(gmic(f=0.666666666))
INFO: 2016-08-01 16:22:48,343 Rational case.
(499999997/333333331, -499999973/166666658)

Selective ticks labels

The ticks labels often overlap. Should select or make it easy to move the labels.

Random matplotlib links:

axis and tick API — Matplotlib 2.2.2 documentation
https://matplotlib.org/api/axis_api.html

python - Matplotlib showing x-tick labels overlapping despite best efforts - Stack Overflow
https://stackoverflow.com/questions/26700598/matplotlib-showing-x-tick-labels-overlapping-despite-best-efforts

python - How to move a tick's label in matplotlib? - Stack Overflow
https://stackoverflow.com/questions/28615887/how-to-move-a-ticks-label-in-matplotlib

Ticks, tick labels, and grid lines — Astropy v3.0.3
http://docs.astropy.org/en/stable/visualization/wcsaxes/ticks_labels_grid.html

Customizing Ticks | Python Data Science Handbook
https://jakevdp.github.io/PythonDataScienceHandbook/04.10-customizing-ticks.html

Overlapping tick labels on x axis · Issue #258 · aplpy/aplpy
aplpy/aplpy#258

matplotlib - Aligning rotated xticklabels with their respective xticks - Stack Overflow
https://stackoverflow.com/questions/14852821/aligning-rotated-xticklabels-with-their-respective-xticks

matplotlib - LogFormatter tickmarks scientific format limits - Stack Overflow
https://stackoverflow.com/questions/43923966/logformatter-tickmarks-scientific-format-limits

Controlling tick marks in plots - ASKSAGE: Sage Q&A Forum
https://ask.sagemath.org/question/7855/controlling-tick-marks-in-plots/

ticker — Matplotlib 2.2.2 documentation
https://matplotlib.org/api/ticker_api.html

multirow: which_function

example from the docstring to test which function and kept everything else the same.
hsquare.which_function(Polyhedron(vertices=[(5,1),(5,3/2),(11/2,3/2)]))
I took out the vertex argument x here and it threw an error on mod_Zk(x).
This function works when Polyhedron=None, but x cant be None.

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.