Software Design
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreSoftware Design

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 8th, 2003, 12:13 PM
DarkEnergy DarkEnergy is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: England
Posts: 5 DarkEnergy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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.

Reply With Quote
  #2  
Old March 16th, 2003, 11:08 AM
TEMM TEMM is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 7 TEMM User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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

Reply With Quote
  #3  
Old March 16th, 2003, 09:38 PM
DarkEnergy DarkEnergy is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: England
Posts: 5 DarkEnergy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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.

Reply With Quote
  #4  
Old March 24th, 2003, 01:58 AM
heinrich's Avatar
heinrich heinrich is offline
digital sinner
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: sinner's land
Posts: 68 heinrich User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 37 m 30 sec
Reputation Power: 11
Send a message via Yahoo to heinrich
you could use an optimised backtracking alg.

Reply With Quote
  #5  
Old March 24th, 2003, 02:23 PM
DarkEnergy DarkEnergy is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: England
Posts: 5 DarkEnergy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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

Reply With Quote
  #6  
Old March 26th, 2003, 12:24 PM
heinrich's Avatar
heinrich heinrich is offline
digital sinner
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: sinner's land
Posts: 68 heinrich User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 37 m 30 sec
Reputation Power: 11
Send a message via Yahoo to heinrich
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.

Reply With Quote
  #7  
Old March 26th, 2003, 04:17 PM
DarkEnergy DarkEnergy is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: England
Posts: 5 DarkEnergy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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.

Reply With Quote
  #8  
Old March 27th, 2003, 07:15 AM
heinrich's Avatar
heinrich heinrich is offline
digital sinner
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: sinner's land
Posts: 68 heinrich User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 37 m 30 sec
Reputation Power: 11
Send a message via Yahoo to heinrich
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).

Reply With Quote
  #9  
Old March 27th, 2003, 08:39 AM
DarkEnergy DarkEnergy is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: England
Posts: 5 DarkEnergy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Oh I understand , thanks for your clarification.

Thanks again for all your help.

Reply With Quote
  #10  
Old March 27th, 2003, 03:03 PM
heinrich's Avatar
heinrich heinrich is offline
digital sinner
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: sinner's land
Posts: 68 heinrich User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 37 m 30 sec
Reputation Power: 11
Send a message via Yahoo to heinrich
no pb, my pleasure. hope this helps. and hope to hear from you soon.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreSoftware Design > looking for algorithms

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap