Skip to main content

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

Metadata

Release files for graphilp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for graphilp 0.1.0
File Size Uploaded
graphilp-0.1.0.tar.gz 26.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for graphilp 0.1.0
File Interpreter ABI Platform
graphilp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 90.1 kB

Release files / graphilp-0.1.0.tar.gz

Download URL graphilp-0.1.0.tar.gz
Size 26.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b1867ca3106ebc44c5e4209e9359a01128f72e690a16b9ddadea246cf10504a3
BLAKE2b-256 checksum
How to use checksums
d35266ed67719789a53c9ce61066cf5537c57327411525ed40746c76fea44e99
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / graphilp-0.1.0-py3-none-any.whl

Download URL graphilp-0.1.0-py3-none-any.whl
Size 63.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
15b3dc934451e52b38fbfae421900179ef61cf32b442fff10510b610ee6bbaec
BLAKE2b-256 checksum
How to use checksums
7ef239ddcbd2334048c0dbfb6fbda4ab323aefb9614440d97dfc764899c40307
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page