vendredi 7 janvier 2022

Creating random population of precedence feasible activity sequences

I need help for a python code for creating a random population of activity sequences that satisfies precedence constraints among activities. for example:

Activity_List = [1, 2, 3, 4, 5, 6, 7]



Precedence_Constraints = {1: [], 2: [1], 3: [1], 4: [1], 5: [2, 4], 6: [4], 7: [3, 5, 6]}

The output should be like

Population = [[1, 4, 3, 6, 2, 5, 7],[1, 4, 6, 2, 5, 3, 7],[1, 2, 4, 3, 6, 5, 7],...]



Aucun commentaire:

Enregistrer un commentaire