• Advertisement
Sign in to follow this  

Algorithm Rewrite Bug?

This topic is 1836 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am reading the paper "An enhanced recursive frequency splitting broadcasting algorithm for near video-on-demand services" written by Yu-Wei Chen.


There is something which confused me. Here is the algorithm explained as in the paper. And following is the algorithm I wrote in Python. The thing is my algorithm outputs different integers than it is given in the paper as a table. I highly doubt that there is an error or bug in a scientific paper but I can't seem to find the reason. I wanted to get a second opinion before contacting the author.





import math
c = 2
k = 3
subChannelCount = int(math.floor(math.sqrt(c)))
POOL = []
class SlotSequence:
  ChannelNumber = 0
  p = 0
  q = 0
for i in range(k):
    for subChannel in range(subChannelCount):
        SS = SlotSequence()
        SS.ChannelNumber = i
        SS.p = subChannel
        SS.q = subChannelCount
j = c
while(len(POOL) > 0):
    minMod = 1000000000
    minModIndex = -1
    for idx,SS in enumerate(POOL):
        if SS.q <= j:
            if (j % SS.q) < minMod:
                minMod = j % SS.q
                minModIndex = idx
    SS = POOL.pop(minModIndex)
    alpha = int(math.floor(j/SS.q))
    for x in range(1,alpha):
        splitSS = SlotSequence()
        splitSS.ChannelNumber = SS.ChannelNumber
        splitSS.p = SS.p+x*SS.q
        splitSS.q = alpha*SS.q
    j = j + 1
print j-c 
Edited by Eralp

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement