How to optimize the order of elements based on similarity coefficients?How do you detect Credit card type based on number?Fastest sort of fixed length 6 int arrayClosest Pair of Points AlgorithmMap Tiling AlgorithmImage Processing: Algorithm Improvement for 'Coca-Cola Can' RecognitionGiven an even number of vertices, how to find an optimum set of pairs based on proximity?Finding the best cosine similarity in a set of vectorsHow to pair socks from a pile efficiently?Find row and column number of eight neighbors conditionally in MatlabHow to select k nodes in a fully connected graph with max separation between any pair of nodes?

Is it better in terms of durability to remove card+battery or to connect to charger/computer via USB-C?

How was the Shuttle loaded and unloaded from its carrier aircraft?

What minifigure is this?

Four ships at the ocean with the same distance

Is it okay to use open source code to do an interview task?

How do I explain that I don't want to maintain old projects?

VHF 50 Ω Antenna Over 75 Ω TV Coax

Is there a strong legal guarantee that the U.S. can give to another country that it won't attack them?

Are there red cards that offer protection against mass token destruction?

When an electron changes its spin, or any other intrinsic property, is it still the same electron?

Run Bash scripts in folder all at the same time

Is this Cambridge Dictionary example of "felicitate" valid?

Strong Password Detection in Python

When did "&" stop being taught alongside the alphabet?

Party going through airport security at separate times?

When do flights get cancelled due to fog?

How to convert diagonal matrix to rectangular matrix

User Vs. Connected App

Swapping "Good" and "Bad"

Can Jimmy hang on his rope?

Can a landlord force all residents to use the landlord's in-house debit card accounts?

What was the profession 芸者 (female entertainer) called in Russia?

Category-theoretic treatment of diffs, patches and merging?

What was the profession 芸者 (female entertainer) called in Germany?



How to optimize the order of elements based on similarity coefficients?


How do you detect Credit card type based on number?Fastest sort of fixed length 6 int arrayClosest Pair of Points AlgorithmMap Tiling AlgorithmImage Processing: Algorithm Improvement for 'Coca-Cola Can' RecognitionGiven an even number of vertices, how to find an optimum set of pairs based on proximity?Finding the best cosine similarity in a set of vectorsHow to pair socks from a pile efficiently?Find row and column number of eight neighbors conditionally in MatlabHow to select k nodes in a fully connected graph with max separation between any pair of nodes?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I have to reorder a sequence of elements based on the similarity between each other (expressed by a coefficient) so that each element is the most similar possible to each of its neighbors. I have to find an algorithm rather than a code.



Example with 10 elements and similarity coefficients calculated for each pair of the elements below :



enter image description here



The excel file can be find here : https://1drv.ms/x/s!AtmZN4-kjgrPms99fqgaDwAS_F4uYw



What I have tried :



  1. Find a pair with the highest coefficient. In the example : 0.98 for T3 (left-end) and T5 (right-end)

  2. Find maximum coefficient between the left-end and the remaining elements

  3. Find maximum coefficient between the right-end and the remaining elements

  4. Take the maximum between 2. and 3.

  5. If maximum is 2. add on the left the element corresponding to the maximum coefficient for the left-end. Else, add on the right the element corresponding to the maximum coefficient for the right-end

  6. Repeat points 2 - 6 until no elements left.

Here is the result :



enter image description here



The result isn't bad. One of the disadvantages I see is that 0.99>0.98 is considered in the same way as 0.99>0.01.



The second option I thought about was maximizing the sum of coefficients between all neighbors, but don't really know where to start from. Especially if there are significantly more than 10 elements. More, it could result in a more "flat" order where while having better similarities overall some extremely similar elements could be placed far from each other.



Being really new to this kind of problems I am pretty sure this should be a rather standard issue with existing solutions. Could you please point to those?



Thank you!










share|improve this question




























    0















    I have to reorder a sequence of elements based on the similarity between each other (expressed by a coefficient) so that each element is the most similar possible to each of its neighbors. I have to find an algorithm rather than a code.



    Example with 10 elements and similarity coefficients calculated for each pair of the elements below :



    enter image description here



    The excel file can be find here : https://1drv.ms/x/s!AtmZN4-kjgrPms99fqgaDwAS_F4uYw



    What I have tried :



    1. Find a pair with the highest coefficient. In the example : 0.98 for T3 (left-end) and T5 (right-end)

    2. Find maximum coefficient between the left-end and the remaining elements

    3. Find maximum coefficient between the right-end and the remaining elements

    4. Take the maximum between 2. and 3.

    5. If maximum is 2. add on the left the element corresponding to the maximum coefficient for the left-end. Else, add on the right the element corresponding to the maximum coefficient for the right-end

    6. Repeat points 2 - 6 until no elements left.

    Here is the result :



    enter image description here



    The result isn't bad. One of the disadvantages I see is that 0.99>0.98 is considered in the same way as 0.99>0.01.



    The second option I thought about was maximizing the sum of coefficients between all neighbors, but don't really know where to start from. Especially if there are significantly more than 10 elements. More, it could result in a more "flat" order where while having better similarities overall some extremely similar elements could be placed far from each other.



    Being really new to this kind of problems I am pretty sure this should be a rather standard issue with existing solutions. Could you please point to those?



    Thank you!










    share|improve this question
























      0












      0








      0








      I have to reorder a sequence of elements based on the similarity between each other (expressed by a coefficient) so that each element is the most similar possible to each of its neighbors. I have to find an algorithm rather than a code.



      Example with 10 elements and similarity coefficients calculated for each pair of the elements below :



      enter image description here



      The excel file can be find here : https://1drv.ms/x/s!AtmZN4-kjgrPms99fqgaDwAS_F4uYw



      What I have tried :



      1. Find a pair with the highest coefficient. In the example : 0.98 for T3 (left-end) and T5 (right-end)

      2. Find maximum coefficient between the left-end and the remaining elements

      3. Find maximum coefficient between the right-end and the remaining elements

      4. Take the maximum between 2. and 3.

      5. If maximum is 2. add on the left the element corresponding to the maximum coefficient for the left-end. Else, add on the right the element corresponding to the maximum coefficient for the right-end

      6. Repeat points 2 - 6 until no elements left.

      Here is the result :



      enter image description here



      The result isn't bad. One of the disadvantages I see is that 0.99>0.98 is considered in the same way as 0.99>0.01.



      The second option I thought about was maximizing the sum of coefficients between all neighbors, but don't really know where to start from. Especially if there are significantly more than 10 elements. More, it could result in a more "flat" order where while having better similarities overall some extremely similar elements could be placed far from each other.



      Being really new to this kind of problems I am pretty sure this should be a rather standard issue with existing solutions. Could you please point to those?



      Thank you!










      share|improve this question














      I have to reorder a sequence of elements based on the similarity between each other (expressed by a coefficient) so that each element is the most similar possible to each of its neighbors. I have to find an algorithm rather than a code.



      Example with 10 elements and similarity coefficients calculated for each pair of the elements below :



      enter image description here



      The excel file can be find here : https://1drv.ms/x/s!AtmZN4-kjgrPms99fqgaDwAS_F4uYw



      What I have tried :



      1. Find a pair with the highest coefficient. In the example : 0.98 for T3 (left-end) and T5 (right-end)

      2. Find maximum coefficient between the left-end and the remaining elements

      3. Find maximum coefficient between the right-end and the remaining elements

      4. Take the maximum between 2. and 3.

      5. If maximum is 2. add on the left the element corresponding to the maximum coefficient for the left-end. Else, add on the right the element corresponding to the maximum coefficient for the right-end

      6. Repeat points 2 - 6 until no elements left.

      Here is the result :



      enter image description here



      The result isn't bad. One of the disadvantages I see is that 0.99>0.98 is considered in the same way as 0.99>0.01.



      The second option I thought about was maximizing the sum of coefficients between all neighbors, but don't really know where to start from. Especially if there are significantly more than 10 elements. More, it could result in a more "flat" order where while having better similarities overall some extremely similar elements could be placed far from each other.



      Being really new to this kind of problems I am pretty sure this should be a rather standard issue with existing solutions. Could you please point to those?



      Thank you!







      algorithm grouping heuristics






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 25 at 23:18









      NoazertyNoazerty

      131 silver badge3 bronze badges




      131 silver badge3 bronze badges






















          1 Answer
          1






          active

          oldest

          votes


















          0














          After researching I have found that my problem can be seen as the "Travelling Salesman Problem" (TSP). More here : https://en.wikipedia.org/wiki/Travelling_salesman_problem



          To apply it you can see "elements" in my example as "cities" in TSP and (1-Similarity coefficient) as "distances".






          share|improve this answer






















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55347759%2fhow-to-optimize-the-order-of-elements-based-on-similarity-coefficients%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            After researching I have found that my problem can be seen as the "Travelling Salesman Problem" (TSP). More here : https://en.wikipedia.org/wiki/Travelling_salesman_problem



            To apply it you can see "elements" in my example as "cities" in TSP and (1-Similarity coefficient) as "distances".






            share|improve this answer



























              0














              After researching I have found that my problem can be seen as the "Travelling Salesman Problem" (TSP). More here : https://en.wikipedia.org/wiki/Travelling_salesman_problem



              To apply it you can see "elements" in my example as "cities" in TSP and (1-Similarity coefficient) as "distances".






              share|improve this answer

























                0












                0








                0







                After researching I have found that my problem can be seen as the "Travelling Salesman Problem" (TSP). More here : https://en.wikipedia.org/wiki/Travelling_salesman_problem



                To apply it you can see "elements" in my example as "cities" in TSP and (1-Similarity coefficient) as "distances".






                share|improve this answer













                After researching I have found that my problem can be seen as the "Travelling Salesman Problem" (TSP). More here : https://en.wikipedia.org/wiki/Travelling_salesman_problem



                To apply it you can see "elements" in my example as "cities" in TSP and (1-Similarity coefficient) as "distances".







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 30 at 23:27









                NoazertyNoazerty

                131 silver badge3 bronze badges




                131 silver badge3 bronze badges


















                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55347759%2fhow-to-optimize-the-order-of-elements-based-on-similarity-coefficients%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                    은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현