Skip to content

Instantly share code, notes, and snippets.

View rschwarz's full-sized avatar

Robert Schwarz rschwarz

View GitHub Profile
@rschwarz
rschwarz / zebra.py
Created May 11, 2012 20:24
'We solve the Zebra Puzzle with the help of a MIP model and SCIP
'''We solve the Zebra Puzzle with the help of a MIP model and SCIP'''
from zibopt import scip
# see https://en.wikipedia.org/wiki/Zebra_Puzzle
houses = range(5)
nations = ['England', 'Japan', 'Norway', 'Spain', 'Ukraine']
pets = ['dog', 'fox', 'horse', 'snails', 'zebra']
drinks = ['coffee', 'milk', 'orange juice', 'tea', 'water']
colors = ['blue', 'green', 'ivory', 'red', 'yellow']

Keybase proof

I hereby claim:

  • I am leethargo on github.
  • I am leethargo (https://keybase.io/leethargo) on keybase.
  • I have a public key is ASDYdYeOdpu-m35lXs6AfAkhGqII2zaAcrWGnGhFdaGJMwo

To claim this, I am signing this object:

using LightGraphs
function incidence_matrix_edges(g::SimpleGraph, T::DataType=Int)
    n_v = nv(g)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rschwarz
rschwarz / scip_cffi_static.ipynb
Created June 7, 2016 17:08
calling static functions in SCIP using cffi
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rschwarz
rschwarz / config.log
Created September 9, 2016 20:13
Logging file from failing Lapack build withing Ipopt.jl
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by ThirdPartyLapack configure 1.5.2, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ ../configure --prefix=/home/rs/.julia/v0.4/Ipopt/deps/usr --disable-shared --with-pic
## --------- ##
## Platform. ##
@rschwarz
rschwarz / ipopt.log
Created September 10, 2016 12:00
Ipopt compilation with additional configure flags
julia> Pkg.build("Ipopt")
INFO: Building Ipopt
INFO: Attempting to Create directory /home/rs/.julia/v0.4/Ipopt/deps/downloads
INFO: Directory /home/rs/.julia/v0.4/Ipopt/deps/downloads already created
INFO: Downloading file http://www.coin-or.org/download/source/Ipopt/Ipopt-3.12.1.tgz
INFO: Done downloading file http://www.coin-or.org/download/source/Ipopt/Ipopt-3.12.1.tgz
INFO: Attempting to Create directory /home/rs/.julia/v0.4/Ipopt/deps/src
INFO: Directory /home/rs/.julia/v0.4/Ipopt/deps/src already created
INFO: Attempting to Create directory /home/rs/.julia/v0.4/Ipopt/deps
INFO: Directory /home/rs/.julia/v0.4/Ipopt/deps already created
@rschwarz
rschwarz / pipe_example.instance.json
Last active October 12, 2016 21:38
plots.jl & recipes
{
"nodes": [
{
"x": 36.0,
"y": 72.0
},
{
"x": 90.0,
"y": 90.0
},
@rschwarz
rschwarz / memleaks.jl
Created January 11, 2017 18:04
Demo memory leaks in SCIP.jl
using JuMP
using Cbc
using SCIP
function leaky(solver, d)
m = Model(solver=solver)
@variable(m, x[1:d] >= 0)
solve(m)
end
@rschwarz
rschwarz / gc.log
Last active February 27, 2017 15:31
run once to warm up.
force garbage collection.
run once to warm up (again).
force garbage collection.
-- calling CSIPfreeModel -- 0 mem used
run 3x
force garbage collection.
-- calling CSIPfreeModel -- 0 mem used
-- calling CSIPfreeModel -- 19043000 mem used
-- calling CSIPfreeModel -- 9521500 mem used