The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages - More
> Software Design
|
looking for algorithms
Discuss looking for algorithms in the Software Design forum on Dev Shed. looking for algorithms Software design forum discussing design principles and non-language specific algorithms. Get help with logic, algebraic, or relational concepts.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

March 8th, 2003, 12:13 PM
|
|
Junior Member
|
|
Join Date: Mar 2003
Location: England
Posts: 5
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
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.
|

March 16th, 2003, 11:08 AM
|
|
Junior Member
|
|
Join Date: Dec 2002
Posts: 7
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Check out priority Queues, they should be able to do what you want with some tinkering
|

March 16th, 2003, 09:38 PM
|
|
Junior Member
|
|
Join Date: Mar 2003
Location: England
Posts: 5
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
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.
|

March 24th, 2003, 01:58 AM
|
 |
digital sinner
|
|
Join Date: Mar 2003
Location: sinner's land
Posts: 68
Time spent in forums: 4 h 37 m 30 sec
Reputation Power: 11
|
|
|
you could use an optimised backtracking alg.
|

March 24th, 2003, 02:23 PM
|
|
Junior Member
|
|
Join Date: Mar 2003
Location: England
Posts: 5
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
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 
|

March 26th, 2003, 12:24 PM
|
 |
digital sinner
|
|
Join Date: Mar 2003
Location: sinner's land
Posts: 68
Time spent in forums: 4 h 37 m 30 sec
Reputation Power: 11
|
|
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. 
Last edited by heinrich : March 26th, 2003 at 12:26 PM.
|

March 26th, 2003, 04:17 PM
|
|
Junior Member
|
|
Join Date: Mar 2003
Location: England
Posts: 5
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
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.
|

March 27th, 2003, 07:15 AM
|
 |
digital sinner
|
|
Join Date: Mar 2003
Location: sinner's land
Posts: 68
Time spent in forums: 4 h 37 m 30 sec
Reputation Power: 11
|
|
|
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).
|

March 27th, 2003, 08:39 AM
|
|
Junior Member
|
|
Join Date: Mar 2003
Location: England
Posts: 5
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Oh I understand , thanks for your clarification.
Thanks again for all your help.
|

March 27th, 2003, 03:03 PM
|
 |
digital sinner
|
|
Join Date: Mar 2003
Location: sinner's land
Posts: 68
Time spent in forums: 4 h 37 m 30 sec
Reputation Power: 11
|
|
no pb, my pleasure. hope this helps. and hope to hear from you soon. 
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|