Results 1 to 3 of 3

Math Help - Minimization Problem

  1. #1
    Newbie
    Joined
    Aug 2007
    Posts
    2

    Thumbs up Minimization Problem

    Hi
    I have the following structure. I have 5 files. Each file can have n number of files. Totally i have 10 subfiles. Now, i want to find the minimum number of Files so that all subfiles will be included.

    For eg:

    File Sub Files
    A 1 2 3 8
    B 2 4 6 10
    C 1 3 5 7 8 9
    D 7 9 10
    E 1 3 7 9


    If i combine B and C all the 10 subfiles will be handled. 1,2,3,4,5,6,7,8,9,10.
    I think that is the minimun combination to cover all sub files. Is there any algoirthm to find this? Actually in my problem to develop a tool, I can have n number of files and n number of subfiles. Please tell me how to find the minimum number of files required to cover all the files. Which concept can be used for this case ?

    Thanks.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by viswastone View Post
    Hi
    I have the following structure. I have 5 files. Each file can have n number of files. Totally i have 10 subfiles. Now, i want to find the minimum number of Files so that all subfiles will be included.

    For eg:

    File Sub Files
    A 1 2 3 8
    B 2 4 6 10
    C 1 3 5 7 8 9
    D 7 9 10
    E 1 3 7 9


    If i combine B and C all the 10 subfiles will be handled. 1,2,3,4,5,6,7,8,9,10.
    I think that is the minimun combination to cover all sub files. Is there any algoirthm to find this? Actually in my problem to develop a tool, I can have n number of files and n number of subfiles. Please tell me how to find the minimum number of files required to cover all the files. Which concept can be used for this case ?

    Thanks.
    Brute force:

    Code:
     
    for file= A to E 
      if file contains all 10 files
        return file
      endif
    endfor
     
    for file1=A to E
      for file2 = fileAfter(file1) to E
        if file1 union file 2 contains all 10 files
           return file 1, file2
        endif
      endfor
    endfor
     
    for file1=A to E
      for file2 = fileAfter(file1) to E
        for file3= fileAfter(file2) to E
          if file1 union file2 union file3 contains all 10 files
            return file 1, file2, file3
          endif
        endfor
      endfor
    endfor
     
    for file1=A to E
      for file2 = fileAfter(file1) to E
        for file3= fileAfter(file2) to E
          for file4= fileAfter(file3) to E
            if file1 union file2 union file3 union file 4 contains all 10 files
              return file 1, file2, file3, file4
            endif
          endfor
        endfor
      endfor
    endfor
     
    retuen A, B, C, D, E
    RonL
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Aug 2007
    Posts
    2

    Smile Thanks.

    Hi, thanks for giving me the logic.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Minimization problem
    Posted in the Calculus Forum
    Replies: 5
    Last Post: December 9th 2011, 08:42 AM
  2. Minimization Problem.
    Posted in the Calculus Forum
    Replies: 9
    Last Post: November 11th 2010, 07:48 PM
  3. Minimization problem
    Posted in the Differential Geometry Forum
    Replies: 0
    Last Post: May 25th 2010, 02:51 PM
  4. Minimization problem
    Posted in the Calculus Forum
    Replies: 1
    Last Post: March 8th 2010, 10:04 AM
  5. Minimization problem - please help!
    Posted in the Calculus Forum
    Replies: 1
    Last Post: January 14th 2009, 06:54 PM

Search Tags


/mathhelpforum @mathhelpforum