Click here to Skip to main content
15,881,852 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: a special type of bin packing problem Pin
harold aptroot20-Jul-15 4:25
harold aptroot20-Jul-15 4:25 
GeneralRe: a special type of bin packing problem Pin
Cenator18-Aug-15 20:28
Cenator18-Aug-15 20:28 
AnswerRe: a special type of bin packing problem Pin
Patrice T22-Jul-15 8:10
mvePatrice T22-Jul-15 8:10 
GeneralRe: a special type of bin packing problem Pin
Member 1179127122-Jul-15 8:25
Member 1179127122-Jul-15 8:25 
GeneralRe: a special type of bin packing problem Pin
Cenator22-Jul-15 18:53
Cenator22-Jul-15 18:53 
GeneralRe: a special type of bin packing problem Pin
Patrice T22-Jul-15 20:21
mvePatrice T22-Jul-15 20:21 
GeneralRe: a special type of bin packing problem Pin
Patrice T22-Jul-15 22:10
mvePatrice T22-Jul-15 22:10 
GeneralRe: a special type of bin packing problem Pin
Cenator22-Jul-15 22:17
Cenator22-Jul-15 22:17 
Thanks Rose | [Rose]

Yes; Best way is here:
C#
LinkBinsOrItems.sortItemList();//Biggeset To Smallest
LinkBinsOrItems.sortBinList();//Smallest To Biggest


Best Sort Mode:

C#
private void btnBestMode_Click(object sender, EventArgs e)
{
    //Check if Lists Are Empty?
    //If the LinkedList<T> is empty, the First and Last properties contain null.
    if (LinkBinsOrItems.listOfBins == null)
    {
        if (LinkBinsOrItems.listOfItems == null)//If Both Of Lists Are Empty
        {
            MessageBox.Show("Item List And Also Bin List Are Empty!!"
                +"You Must Enter Bins And Items..."
                , "Bin List And Item list Empty Error", MessageBoxButtons.OK
                , MessageBoxIcon.Information);
            return;
        }
        //If Only Bin List Is Empty
        MessageBox.Show("Bin List Is Empty!! You Must Enter Bins...", "Bin List Empty Error"
            , MessageBoxButtons.OK, MessageBoxIcon.Information);
        return;
    }
    //If Only Item List Is Empty
    if (LinkBinsOrItems.listOfItems == null)
    {
        MessageBox.Show("Item List is Empty!! You Must Enter Items..."
            , "Item List Empty Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
        return;
    }

    //Show Warning To User
    DialogResult result = MessageBox.Show("Are you sure you want to do sorting "
        +"for creat more free space?(This can change items places"
        , "Sort For Best Mode",MessageBoxButtons.YesNo,MessageBoxIcon.Question);
    if (result == DialogResult.No)
        return;

    LinkedListNode<Item> itemNode;
    LinkedListNode<Bin> binNode;

    //Clear Bins And Items Relations
    itemNode = LinkBinsOrItems.listOfItems.First;
    for (int i = 1; i <= LinkBinsOrItems.listOfItems.Count; i++)
    {
        itemNode.Value.BinNumber = -1;
    }
    binNode = LinkBinsOrItems.listOfBins.First;
    for (int i = 1; i <= LinkBinsOrItems.listOfBins.Count; i++)
    {
        binNode.Value.clearRelations();
    }

    //Sort Bin And Item List:
    LinkBinsOrItems.sortItemList();//Biggeset To Smallest
    LinkBinsOrItems.sortBinList();//Smallest To Biggest

    //Do Placing:
    listBox1.Items.Add("");
    itemNode = LinkBinsOrItems.listOfItems.First;
    for (int i = 1; i <= LinkBinsOrItems.listOfItems.Count; i++)
    {
        listBox1.Items.Add(itemNode.Value);
        listBox2.Items.Add(LinkBinsOrItems.placeItemInBin(itemNode.Value));
        itemNode = itemNode.Next;
    }

    //Inintal Rrport
    itemReportInitaling();//test
    BinReportInitaling();//Test
}

GeneralRe: a special type of bin packing problem Pin
Patrice T23-Jul-15 5:07
mvePatrice T23-Jul-15 5:07 
QuestionGA/GEP Mutation Rates Pin
Dominick Marciano17-Jul-15 11:25
professionalDominick Marciano17-Jul-15 11:25 
AnswerRe: GA/GEP Mutation Rates Pin
Alan Balkany30-Jul-15 7:19
Alan Balkany30-Jul-15 7:19 
QuestionC/C++ algorithm to reorganize and extract the data Pin
feifeihanyu10-Jul-15 4:22
feifeihanyu10-Jul-15 4:22 
SuggestionRe: C/C++ algorithm to reorganize and extract the data Pin
Richard MacCutchan10-Jul-15 4:47
mveRichard MacCutchan10-Jul-15 4:47 
GeneralRe: C/C++ algorithm to reorganize and extract the data Pin
feifeihanyu10-Jul-15 5:53
feifeihanyu10-Jul-15 5:53 
GeneralRe: C/C++ algorithm to reorganize and extract the data Pin
Member 1184955320-Jul-15 3:53
Member 1184955320-Jul-15 3:53 
GeneralRe: C/C++ algorithm to reorganize and extract the data Pin
Richard MacCutchan20-Jul-15 4:40
mveRichard MacCutchan20-Jul-15 4:40 
AnswerRe: C/C++ algorithm to reorganize and extract the data Pin
Supreme Master27-Jul-15 7:44
Supreme Master27-Jul-15 7:44 
GeneralRe: C/C++ algorithm to reorganize and extract the data Pin
Supreme Master27-Jul-15 8:52
Supreme Master27-Jul-15 8:52 
QuestionAlgorithm/Pseudo code help for swapping/comparing values Pin
Member 118111963-Jul-15 1:21
Member 118111963-Jul-15 1:21 
AnswerRe: Algorithm/Pseudo code help for swapping/comparing values Pin
Alan Balkany9-Jul-15 11:48
Alan Balkany9-Jul-15 11:48 
AnswerRe: Algorithm/Pseudo code help for swapping/comparing values Pin
Patrice T10-Jul-15 21:22
mvePatrice T10-Jul-15 21:22 
Generalto downvoter Pin
Patrice T1-Aug-15 12:47
mvePatrice T1-Aug-15 12:47 
GeneralRe: to downvoter Pin
Richard Deeming3-Aug-15 2:26
mveRichard Deeming3-Aug-15 2:26 
GeneralRe: to downvoter Pin
Patrice T3-Aug-15 10:31
mvePatrice T3-Aug-15 10:31 
QuestionMaybe Original Algorithm Created Pin
Rui__Silva25-Jun-15 5:24
professionalRui__Silva25-Jun-15 5:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.