Helpful Information
 
 
Category: Software Design
looking for algorithms

I need to write a couple of algorithms for a radio scheduling program I'm writing:

1) I need to organise a bunch of different Ads into a playlist. The ads are to be played various numbers of times. The rules are:

- the same ad should not be played consecutivley

- and I would like the same ads to be as far away from each other in the list as possible so its not repitive.

2) I need to select a number of ads from a pool to fill a certain length of time. That is a need to find a combination of ads that will fill the time. Also if no combination of ads will fit I need to find the best fit whether its slightly over or under

Any pointers, tips, links etc would be greatly appreciated as I am a total noobie to algorithms.

Thanks in advance.

Check out priority Queues, they should be able to do what you want with some tinkering

Hi TEMM,

Thanks for your suggestion. I will read up on priority queues and hopefully I'll be able to find a solution.

Much appreciated.

you could use an optimised backtracking alg.

Hi heinrich,

I will certainly investigate your suggestion , thanks very much.

Could you tell me whether you would use this approach to tackle the first or second problem.

Cheers mate :)

actually i think you could use a backtracking algorithm in both problems.
look on the internet for documentation on this kind of alg.
if you don't find anything, send me an email and i'll try to send you a more detailed explanation and maybe a solution.
but i have to tell you that this is not the best solution(the fastest), but since the first returned solution is enough for your program, i think it's very practical for you.:)

Oh I see, great, I'll read up on this.

Speed is not the prime concern and I suppose the first returned solution would be sufficient.

Out of interest though what is the fastest solution and what are its disadvantages over the backtracking approach.

Thanks for your help, I really appreciate it.

if speed is not your concern, then you can use this alg. in both problems.
the disadvantage of backtracking is that it returnes all solutions and it tries all the posibilities(this is it's weak point), but you can optimize it and it will be faster.
And also you can stop the alg. when you get the 1st solution.
a faster solution (i don't know if it's the fastest) could be using graphs(i'm not sure how they are called in english; they are a more generalized form of binary trees).

Oh I understand , thanks for your clarification.

Thanks again for all your help.

no pb, my pleasure. hope this helps. and hope to hear from you soon. :)










privacy (GDPR)