[algogeeks] Re: constraint programming
I'm not familiar with Choco in particular but you are probably trying to post an element constraint. Make sure that the index variable has a domain inside the range of the array on which you apply the element (-1 should not be in the domain). On Jul 29, 1:24 am, hafsainfo haafsa...@gmail.com wrote: Good evening, I dont think where is the error in the command written in Java with choco solver if anyone can help me to find the solution: mp.addConstraint (nth (s [i], a [i], Constant (1))); and here the error that appears : Exception in thread main java.lang.ArrayIndexOutOfBoundsException: -1 at Tsp.main Thank you in advance -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: Scheduling dp problem - MSFT interview
sort the jobs increasingly according to ratio: duration/penalty. It is easy to prove it's optimal for two jobs. Then you generalize the proof for n jobs easily because you can swap two consecutive jobs i,j that have duration(i)/penalty(i)duration(j)/ penalty(j) to decrease the total penalty of the schedule (same reasoning as for two jobs + a constant for the ones before and after that remain unchanged). On May 30, 7:00 pm, ross jagadish1...@gmail.com wrote: You are given a sequence of jobs. The no. of days which each job takes to complete is also provided. You are also given the penalty amount to be paid per day each day a job left done. Give an optimal ordering among jobs to minimize penalty. There are no concurrent jobs. eg: Jobs: J1 J2 J3 no. of days to complete: 1 10 4 Penalty incurred each day 1000 30 40 the job is pending output: Schedule is J1 J3 J2 hence, J1 goes for 1st day. J3 for subsequent 4 days. J2 for the next 10 days. Penalty incurred = (delay for job i ) * (penalty per day of job i) = = (0)(1000) + (1)(40) + 5(30) = 190 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: Simulation algo
I don't think Ant-Colony-Optimization is related to Discrete Event Simulation. If you are looking for a framework to model DES, you may have look at SimPy http://simpy.sourceforge.net/ Cheers, Pierre On 24 déc, 04:29, Chi i...@chihoang.de wrote: Ant-Colony-Optimization - Ursprüngliche Mitteilung - Hello, I'm looking for an algorithm of computer science simulation and specifically the discrete simulation of any model. Please All the best. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group athttp://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.