Looking for algorithm . . . .

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Eric J. Holtman

    #1

    Looking for algorithm . . . .


    I have a list of stocks I've divided into groups (say, partitioning A).
    I have another list of the same stocks, divided differently, (say,
    partitioning B).

    Is there a way to determine the least "swaps" so that I can turn
    B into A?

    I.E. given A: 1,2,3 4,5 6 7,8
    B: 1,2,4, 3,5,6 7 8

    tell me: swap 3 and 4
    remove 6 from 4,5,6 into own group
    meld 7 and 8.


    (This isn't a homework assignment. I've been out of school
    for 18 years. I've just been away from graph theory/set theory
    for too long.... and was hoping someone would recognize this
    problem and point me to a solution).



  • Victor Bazarov

    #2
    Re: Looking for algorithm . . . .

    Eric J. Holtman wrote:[color=blue]
    > I have a list of stocks I've divided into groups (say, partitioning A).
    > I have another list of the same stocks, divided differently, (say,
    > partitioning B).
    >
    > Is there a way to determine the least "swaps" so that I can turn
    > B into A?
    > [...][/color]

    This is not a C++ language problem. Please post to comp.programmin g.

    V

    Comment

    Working...