6

I'm trying to develop a c# application that will generate a list of all possible permutations, within a limit, and cost. For example, I have a list of 80 jobs. Each job has a value (1-5) (typically 3) and each engineer has a limit of how much they can do, typically a value of 20.

At the moment I've started by producing a list of all possible combinations (n! / (k! * (n-k)! where n is the total number of jobs and k is 2). The link between each job should be weighted with the distance between each job.

From here I would like to pick an initial start job and produce a list of all possible combinations of jobs (from the start job) up to the limit of 20 and then ordered on the sum of the weight. The lowest weight route would win and be allocated to the engineer. My problem is that I don't know how to approach this - what data structure would be best?

Typically there are approx 6-8 engineers (depending on workload), I had planned on routing each engineer one at a time - once a route had been allocated to another engineer, those jobs would be removed from the list and a new start job selected with a new set of combinations generated. Does this sound like an acceptable approach?

Any assistance would be welcome.

9
  • 1
    this sounds like a math problem basically, instead of a c# problem. (though both are very close) : Commented Sep 14, 2010 at 16:18
  • 6
    There's a C# library for doing permutations, combinations, Cartesian products and other handy combinatorics functions here: codeproject.com/KB/recipes/Combinatorics.aspx Commented Sep 14, 2010 at 18:16
  • 1
    The description does remind "knapsack" or "job scheduling" problem. Commented May 15, 2011 at 14:50
  • linear programming, i.e. a job for the simplex algorithm? Commented May 25, 2011 at 7:10
  • @vidstige: you have obviously read another version of the question than I did Commented May 25, 2011 at 8:14

3 Answers 3

2

I would try simulated annealing, an algorithm to find a global optimum by testing configurations randomly according to the energy of the system.

http://en.wikipedia.org/wiki/Simulated_annealing

Check the article for the pseudocode.

Sign up to request clarification or add additional context in comments.

Comments

1

You could look at Microsoft Solver Foundation: http://msdn.microsoft.com/en-us/devlabs/hh145003.aspx

Also, look at Bart de Smet's Linq to Z3 if you are into Linq to Anything :) http://channel9.msdn.com/Shows/Going+Deep/Bart-De-Smet-LINQ-to-Z3

Comments

1

There is no efficient algorithm to solve this problem. I would use a genetic algorithm (does not necessarily find the optimal solution but finds an acceptable solution).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.