# Calculate assignments

### Description

This function calculates possible and necessary assignments.

### Usage

1 | ```
calculateAssignments(problem, necessary)
``` |

### Arguments

`problem` |
Problem for which assignments will be calculated. |

`necessary` |
Whether necessary or possible assignments. |

### Value

*n* x *p* logical matrix, where each row represents one
of *n* alternatives and each column represents one of *p* classes.
Element `[i, h]`

is `TRUE`

if:

for necessary assignments: alternative

`a_i`

is always assigned to class`C_h`

,for possible assignments: alternative

`a_i`

can be assigned to class`C_h`

.

### Examples

1 2 3 4 5 6 | ```
perf <- matrix(c(5, 2, 1, 7, 0.5, 0.9, 0.4, 0.4), ncol = 2)
problem <- buildProblem(perf, 3, FALSE, c('g', 'g'), c(0, 0))
problem <- addAssignmentsLB(problem, c(1, 2), c(2, 3))
possibleAssignments <- calculateAssignments(problem, FALSE)
necessaryAssignments <- calculateAssignments(problem, TRUE)
``` |

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.