Skip to content

Targetor: an algorithm for multi-criteria load balancing #297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

SMoraisDev
Copy link

This PR provides a new algorithm that can be used to optimize a partition where the instance has multiple criteria.

The idea of the algorithm is to optimize the partition by achieving the best possible movement or a movement close to it. To do this, the space of weights is discretised into boxes and each weight is associated with a box. The algorithm is iterative, and at each iteration it will determine the best move to make, search the associated box and, if there are no valid moves associated with the box's weight, it will explore nearby boxes, moving further and further away.

Currently, the space of weights is discretised in a regular manner according to values supplied by the user (cf. struct RegularBoxHandler). Other structures can be considered as long as they implement the BoxHandler trait.

The approach to exploring neighbor boxes is based on a progressively increasing neighborhood (see struct NeighborSearchStrat). Other structures can be considered as long as they implement the SearchStrat trait.

SMoraisDev added 17 commits May 26, 2023 23:51
Previous implementation was too poorly developed, I'd rather start
again, building on my accumulated experience.
Previously, the implementation of SearchStrat for NeighborSearchStrat
required the trait bound isize: From<T>. This was not compatible with
the current implementation of Targetor<i32,i32> as isize does not
implement From<i32>.
Define trait PartitionImbalanceHandler which is composed of two
methods:
- compute_imbalances: return the imbalances of the partition over all
criterion while taking into account the criterion target loads.
- process_imbalance: return a couple composed of one of the most
imbalanced criterion and the part from which a weight should me moved.

This trait is implemented for Targetor.
Define trait Repartitioning composed of the method optimize.

This trait is implemented for Targetor.
Previous implementation was just checking if there was a move that
in the same box as the "best" move to do. The added code allows
optimize to explore the boxes close to the "best" move by going further
and further away. This is performed by leveraging the
NeighborSearchStrat approach.
@SMoraisDev
Copy link
Author

Btw, current struct name is TargetorWIP, i'll modify it into Targetor (or whatever other name) once this is no more a draft.

@SebastienMorais
Copy link
Contributor

The current implementation does not handle constant weight (discretizing the weight space between val and val results in None values)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants