Skip to content

Allocate

James Bremner edited this page Mar 17, 2023 · 2 revisions

The option allocates agents to tasks, optimizing the number of tasks that receive agents.

Input

Input is accepted in space delimited text files.

Format

The first line specifies the calculation required. It must contain

format alloc

Possibilities

Each line thereafter specifies an agent and a task that the agent may be applied to

Column Description
1 "l"
2 name of agent
3 name of task

Example

format alloc
g
l child1 chore1
l child1 chore2
l child1 chore3
l child2 chore1
l child2 chore2
l child2 chore3

image

Algorithm

This is a special case of maximum flow through a graph, with multiple sources ( agents ) and sinks ( tasks ) and all edges have their capacity set to 1. If there is a 'flow' from an agent to a task, then it indicates the agent should be assigned to the task.

Clone this wiki locally