Section for working with the assignment problem algorithm

class fuzzyops.sequencing_assignment.solver.FuzzySASolver[source]

Bases: object

Represents the Assignment Problem solver (SAS) using a fuzzy graph

_graph

A fuzzy graph containing information about employees and tasks

Type:

FuzzyGraph

_workers

List of employees

Type:

List[str]

_tasks

Task list

Type:

List[str]

load_graph(graph: FuzzyGraph) None[source]

Loads an empty graph with a certain fuzzy mathematical type

Parameters:

graph (FuzzyGraph) – Fuzzy graph for loading

Raises:

Exception – If the graph is no longer empty or is not an instance of FuzzyGraph

load_task_worker_pair_value(task: str, worker: str, value: List[int]) None[source]

Loads the cost of an assignment for a pair of employee and task

Parameters:
  • task (str) – Assignment task

  • worker (str) – The employee to whom the task is assigned

  • value (List[int]) – The cost of the appointment

Raises:

Exception – If the list of tasks or workers is not loaded

load_tasks_workers(tasks: List[str], workers: List[str]) None[source]

Loads lists of tasks and employees

Parameters:
  • tasks (List[str]) – The list of tasks to download

  • workers (List[str]) – List of workers to upload

Raises:

Exception – If the graph is not loaded, or if tasks and workers are not lists

solve() Dict[source]

The main function of the solution, which implements the Hungarian algorithm

Returns:

A dictionary with employee assignments to tasks and the total cost

Return type:

Dict

Raises:

Exception – If the graph or the lists of workers/tasks are not loaded