Looking for algorithm . . . .

E

Eric J. Holtman

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).
 
V

Victor Bazarov

Eric said:
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?
[...]

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

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,184
Messages
2,570,979
Members
47,580
Latest member
kim2namjoon

Latest Threads

Top