Skip to main content

Utilities for the CG:SHOP 2022 Optimization Competition on Minimum Partition into Plane Subgraphs.

Project description

Official Utilities for the CG:SHOP 2022 Challenge

This package provides some utilities for handling instances and solutions for the CG:SHOP 2022 Challenge on Minimum Partition into Plane Subgraphs. These are the tools that are used by us, the (technical) organizers, to handle our instances and your solutions.

  • Reading and writing instances.
  • Reading and writing solutions.
  • Verifying solutions for correctness.

The source code can be found here.

Installation

The installation is simple:

pip install cgshop2022utils

If pip does not install the dependencies for you you may also need

pip install networkx

The verification component (currently under development) will be implemented in C++ and require a more complicated installation. We will probably provide a precompiled version for Linux, but other systems may need to compile the package by hand. We will provide instructions for this in due time.

Reading instances

from cgshop2022utils.io import read_instance

instance = read_instance("path or file object to instance")

The instance is a dict of the following format:

{
        "type": "Instance_CGSHOP2022",
        "id": "unique name of instance",
        "meta": dict, # with information on the instance (e.g., the polygon for visibility instances)
        "graph": networkx.Graph, # The instance graph with typing.Tuple[int, int] as vertices.
}

Check out the documentation of networkx on how to deal with the graphs. It is fairly straight forward. For example:

print("Points:")
for v in graph.nodes:
    print(v)
print("Edges:")
for v,w in graph.edges:
    print(v, "<->", w)

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

cgshop2022utils-0.1.0-py3-none-any.whl (5.2 kB view hashes)

Uploaded Python 3

Supported by

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