Jump to content

How to loop thro all combinations


Vegeta
 Share

Recommended Posts

Hi,

I'm planning to write a small application like "Burn for the Brim" for my own with AutoIt without all the features I don't need.

For all who don't know the program it's filling a medium (CD/DVD) optimally with your files. It circles thru all possibilities and gives the best (or one of them) solution to you.

To work with this problem two arrays are made. Array 1 with the filename and array two with the filesize.

Array 1, Array 2

File1, 200 MB

File2, 300 MB

File3, 500 MB

There are 6 different combinations possible:

1 2 3

1 3 2

2 1 3

2 3 1

3 2 1

3 1 2

For a medium with 700 MB the solution 1 3 is the best, it fills the CD optimally.

My problem is now that I don't have a good idea how to program an algorithm that loops all possible solutions with x files.

Can anybody give me a hint how I can solve this problem?

Thanks,

Vegeta

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...