Expand description
§Super Fair Division
super_fair_division is a library that provides algorithms for super fair division problems.
It allows users to calculate fair allocations based on input values with or without weights.
§Equal Weights
use super_fair_division::calculate_fair_division_equal_weights;
let input = vec![10, 20, 30];
let allocation = calculate_fair_division_equal_weights(&input).unwrap();
println!("Fair division allocation: {:?}", allocation);§Weighted Division
use super_fair_division::calculate_fair_division_weighted;
let input = vec![10, 20, 30];
let weights = vec![1, 2, 3]; // 权重比例为 1:2:3
let allocation = calculate_fair_division_weighted(&input, &weights).unwrap();
println!("Weighted fair division allocation: {:?}", allocation);Enums§
- Error
- The main error type for the super_fair_division library
Functions§
- calculate_
fair_ division_ equal_ weights - Calculates a super fair division for participants with equal weights.
- calculate_
fair_ division_ weighted - Calculates a super fair division for participants with different weights.
Type Aliases§
- Result
- Result type for the super_fair_division library