Skip to main content

A Python API to automatically cast graph-related optimisation problems into ILP instances for Gurobi

Project description

GraphILP

GraphILP is a Python API to automatically cast graph-related optimisation problems into integer linear programming (ILP) instances.

Simple example

Find the smallest number of colours needed to colour the vertices of a cycle such that adjacent vertices have different colours.

import networkx as nx

from graphilp.imports import networkx as imp_nx
from graphilp.partitioning import min_vertex_coloring as vtx

G_init = nx.cycle_graph(n=5)
G = imp_nx.read(G_init)

m = vtx.create_model(G)
m.optimize()

color_to_node, node_to_color = vtx.extract_solution(G, m)

The best way to get started with GraphILP is through one of our examples.

Installation

GraphILP has two main requirements:

  1. NetworkX is used internally to represent graphs. It is also the easiest way to create problem instances.
  2. GraphILP creates integer linear programs in the form of Gurobi models. To create and solve these models, you need the Gurobi solver and its Python API.

Some additional libraries are required for running the examples.

While GraphILP is not yet on PyPI, it can be installed by checking out the repository and adding the path to your PYTHONPATH. For example:

export PYTHONPATH=$PYTHONPATH:< your path >

Licence

The GraphILP API is released under the MIT License. See LICENSE.txt for the details.

Authors

Core development team

Contributors

  • Adrian Prinz
  • Thomas Sauter

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

graphilp-0.1.0.tar.gz (26.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

graphilp-0.1.0-py3-none-any.whl (63.9 kB view details)

Uploaded Python 3

File details

Details for the file graphilp-0.1.0.tar.gz.

File metadata

  • Download URL: graphilp-0.1.0.tar.gz
  • Upload date:
  • Size: 26.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.12

File hashes

Hashes for graphilp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b1867ca3106ebc44c5e4209e9359a01128f72e690a16b9ddadea246cf10504a3
MD5 719cd561f0e379ba0aab6595a2fb30fb
BLAKE2b-256 d35266ed67719789a53c9ce61066cf5537c57327411525ed40746c76fea44e99

See more details on using hashes here.

File details

Details for the file graphilp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: graphilp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 63.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.12

File hashes

Hashes for graphilp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 15b3dc934451e52b38fbfae421900179ef61cf32b442fff10510b610ee6bbaec
MD5 6c4f2cfbd9ccf27e003453562f99a571
BLAKE2b-256 7ef239ddcbd2334048c0dbfb6fbda4ab323aefb9614440d97dfc764899c40307

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page