Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2004
    Posts
    45

    equal distribution

    I am looking for a formula or a logic to simplify this sort of problem.
    Assume there is a set of values ranging from, say 10 to 20. (can be between any values)
    It can be 11, 15,16,17,17,18 or
    10,12,14,15,16,18,18
    with no fixed size or no. or I say random no.s.
    I need this set devide in to 2 or 3 groups.(may be many groups)
    so each group should result into sum of approximate values.
    For eg. if I group the first set into 'a and 'b'
    then sum of 'a' is approximately equal to sum of 'b'.
    Can you think of any such solution where we can distribute the relative sum into these buckets?
    thanks in advance

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Quote Originally Posted by deebee
    I am looking for a formula or a logic to simplify this sort of problem.
    Assume there is a set of values ranging from, say 10 to 20. (can be between any values)
    It can be 11, 15,16,17,17,18 or
    10,12,14,15,16,18,18
    with no fixed size or no. or I say random no.s.
    I need this set devide in to 2 or 3 groups.(may be many groups)
    so each group should result into sum of approximate values.
    For eg. if I group the first set into 'a and 'b'
    then sum of 'a' is approximately equal to sum of 'b'.
    Can you think of any such solution where we can distribute the relative sum into these buckets?
    thanks in advance
    This is a classic NP-Complete kind of problem. What has the instructor covered in class? What language are you using? Does the solution need to be deterministic? What degree of complexity (in terms of function points) will the assignment allow?

    Uff-da! So many questions, so little time.

    -PatP

  3. #3
    Join Date
    Jul 2004
    Posts
    45
    No one asked this question or it's not an assignment I posted this question in general way. Technically I can put it in this way.
    Assume you will have to sort out the disk space problem. The are no. of files having huge amount of data(in millions). So, it needs more disk space. If I think of partioning disk with equal no. of disk size to store these files, I need to arrange in a such a way that all disks are approximately distributed so there will not be over load or less load to any of them.
    Hope you understood this problem.

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Are you intending to distribute the data volume (meaning all disks have similar amounts of data on them), or disk I/O (meaning all disks have similar performance)? Those are two VERY different problems.

    The intuitively obvious answer for both problems is RAID. Is there a reason that it doesn't work for your case?

    -PatP

  5. #5
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by Pat Phelan
    The intuitively obvious answer for both problems is RAID.
    "intuitive", like "beautiful", is totally within the mind of the observer

    aside: nice to see somebody else besides me linking to techtarget definitions

    but wait a sec

    RAID means redundant, right?

    so if buddy wants to solve a disk space problem by splitting his files into two different places, with the idea that he will split them based on approximate equality in total file size, then throwing redundant copies of all the files into the mix is just going to compound his problem

    deebee, get yourself a disk utility like treesize
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  6. #6
    Join Date
    Jul 2004
    Posts
    45
    Does treesize accomplish unix file system? I read, it's made only for windows.
    Here is the practicle eg.

    Days data volume partition
    1 3,666,550,379 1
    3 3,589,834,500 2
    4 2,087,717,043 3
    5 3,002,279,343 4
    7 3,745,084,775 2
    8 2,000,265,748 1
    9 2,840,623,839 3
    11 4,195,076,838 4
    13 3,560,141,801 2
    14 1,754,869,581 1
    15 3,244,835,353 3
    17 4,062,268,577 4
    18 2,317,179,551 1
    19 2,941,689,040 2
    21 3,477,730,734 3
    22 2,343,090,585 4
    23 3,263,493,976 2
    24 1,834,060,637 1
    25 3,008,413,614 3
    26 1,617,870,914 4
    27 3,055,383,589 1
    29 3,430,339,842 1
    31 2,432,226,591 3

    Here partioned values are assigned manually to make the data valume as avg..
    (Note: some days are skipped for other reasons)
    finally,
    partition Records
    1 18,058,649,327
    2 17,100,244,092
    3 17,091,547,174
    4 17,046,246,275

    Assume, on avg. each partition has 20gb capacity! Now, depends on the no. of partition, how can we distribute the load. Make sure the days should not be broken!!(i.e. for eg. the day 1 should not be splitted into many and whole day data should go to any one of the partition)
    I am looking for the logical way or structure to distribute the load in UNIX rather than any new hardware system!
    Hope this is clear. Let me know if you have more questions. and thanks for your time.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •