Skip to main content

Generalized assignment problem solver

Project description

GAPS

Generalized Assignment Problem Solver

This code aims to implement an efficient solver for the generalized assignment problem.

The generalized assignment problem

The generalized assignment problem is described quite well on Wikipedia.

This code actually allows for further generalization, multiple agents to perform a single task (regulated by a task budget).

The implementation

The implementation is a simple depth-first search algorithm. Therefore, it does not work well for very large problems.

The depth-first search expands most promising nodes first. True maximum assignment is guaranteed when algorithm is allowed to complete. Otherwise, the assignment printed last may be used as a best guess.

The code makes use of frozendict to keep track of the set of assignments.

Running the code

Solving your assignment problem is easy. Just specify your assignment problem (refer to main method in assign.py for an example), then run it. An example problem specification is given, to make clear what syntax is expected.

The code offers a few features:

  • Optional 'hard assignment' initializes the assignment with certain agents assigned to certain tasks
  • Optional 'fair' parameter maximizes the profits related to the least profitable task (and thus equalizes the profits among tasks).
  • Optional 'complete' parameter requires agents and tasks to fully use their budgets.
  • 'verbose' option prettily prints the assignment information after the code finishes. May be turned off.

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

gaps-0.1.1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

gaps-0.1.1-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file gaps-0.1.1.tar.gz.

File metadata

  • Download URL: gaps-0.1.1.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.9.5 Linux/5.4.72-microsoft-standard-WSL2

File hashes

Hashes for gaps-0.1.1.tar.gz
Algorithm Hash digest
SHA256 851c3c5eb8d2dd21d7ad88bf79e1fc3c141d1a1daab1ad68866e97bd88fd88d4
MD5 5ff589ba711899f3ebeabdbcaa03773a
BLAKE2b-256 752ed94f283050f03d0b70116e17c1b3a0512e2dee800d582137e8645f060e71

See more details on using hashes here.

File details

Details for the file gaps-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: gaps-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.9.5 Linux/5.4.72-microsoft-standard-WSL2

File hashes

Hashes for gaps-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8d51fdfc78355ad953d0b5699f51c59c1dcfd0c8341e6e692318c46daf949069
MD5 f2b9e335dca80b98e309b53ac08bf9ce
BLAKE2b-256 25259074c519c12bbd96eaf653745005093b7f1b2876c228faae74807724b320

See more details on using hashes here.

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