If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Chit Chat > equal distribution

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-19-04, 15:32
deebee deebee is offline
Registered User
 
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
Reply With Quote
  #2 (permalink)  
Old 07-20-04, 13:35
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
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
Reply With Quote
  #3 (permalink)  
Old 07-20-04, 16:37
deebee deebee is offline
Registered User
 
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.
Reply With Quote
  #4 (permalink)  
Old 07-20-04, 16:56
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
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
Reply With Quote
  #5 (permalink)  
Old 07-20-04, 19:26
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
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
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #6 (permalink)  
Old 07-21-04, 11:42
deebee deebee is offline
Registered User
 
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On