Orders and Matchings
4 nodes
On this page 4
Maximum Matching
FunctionAs many pairs as can be made between a left set and a right set, each pair along an allowed edge and nothing used twice: workers to jobs, players to seats. The nth edge joins left[n] to right[n].
Signature
MaximumMatching -> (Pairs: Integer, partners: Integer Array)
leftCount: Integer
rightCount: Integer
edgeLefts: Integer Array
edgeRights: Integer Arrayint MaximumMatching(
int leftCount,
int rightCount,
int[] edgeLefts,
int[] edgeRights,
out int[] partners)Parameters
| name | type | default | description |
|---|---|---|---|
| leftCount | Integer | — | How many on the left, numbered from 0. |
| rightCount | Integer | — | How many on the right, numbered from 0. |
| edgeLefts | Integer Array | — | Each allowed edge's left end. |
| edgeRights | Integer Array | — | Each allowed edge's right end. |
Returns
| Pairs | Integer |
| partners | Integer Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Orders and Matchings
- Package
- Crime Engine
Random Permutation
FunctionThe numbers 0 to count - 1 in a random order.
Signature
Permutation(count: Integer, seed: Integer) -> Integer Array
int[] Permutation(int count, int seed = 1)
Parameters
| name | type | default | description |
|---|---|---|---|
| count | Integer | — | How many. |
| seed | Integer | 1 | The same seed gives the same order. |
Returns
| Order | Integer Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Orders and Matchings
- Package
- Crime Engine
Random Sample
FunctionSome of the numbers 0 to from - 1, none twice, in a random order.
Signature
Sample -> Integer Array
count: Integer
from: Integer
seed: Integerint[] Sample(int count, int from, int seed = 1)
Parameters
| name | type | default | description |
|---|---|---|---|
| count | Integer | — | How many to take. |
| from | Integer | — | How many there are to take from. |
| seed | Integer | 1 | The same seed gives the same sample. |
Returns
| Sample | Integer Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Orders and Matchings
- Package
- Crime Engine
Shuffle Numbers
FunctionThe numbers in a random order.
Signature
Shuffle(values: Integer Array, seed: Integer) -> Integer Array
int[] Shuffle(int[] values, int seed = 1)
Parameters
| name | type | default | description |
|---|---|---|---|
| values | Integer Array | — | The numbers. |
| seed | Integer | 1 | The same seed gives the same order. |
Returns
| Shuffled | Integer Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Orders and Matchings
- Package
- Crime Engine