Computer Science Asked by iouoneusername on October 31, 2020
While making name-tags for a dinner seating, I stumbled upon a problem which I can’t find any algorithm to solve, and I’m not sure where to begin.
The goal is to write the name of each dinner guest on a card, completing one name at a time.
The names are written with old-fashioned rubber stamps, so only 6 letters can be "active" at any given time. When a new letter is required, one of the active letters has to be swapped out for the new letter.
The problem is to sort the names in such an order, that I need to do the least amount of letter-swapping.
Example
I want to write the names:
I can do this with 3 letter-swaps
Initial letters: J A C K H U
Write: Jack, Chuck
{swap A, C, K with L, I, E}
New active letters:
J L I E H U
Write: Julie
Now I want to find an algorithm that, given a list of names and a limit of active characters, provide the order of names and which letters to swap at each name, to reduce the total amount of letter-swaps.
Any ideas or pointers are welcome.
3 Asked on February 21, 2021 by always-newbie
1 Asked on February 20, 2021 by saku
1 Asked on February 20, 2021 by rossko_dca
1 Asked on February 17, 2021 by donvitomarco
0 Asked on February 16, 2021 by von-spotz
0 Asked on February 13, 2021 by adam-cole
a star search algorithms euclidean distance graphs shortest path
1 Asked on February 13, 2021 by aviv-barel
5 Asked on February 10, 2021 by gizmo
0 Asked on February 10, 2021 by arthur-b
1 Asked on February 8, 2021 by keith-paton
1 Asked on February 7, 2021 by user3661613
1 Asked on February 6, 2021 by builderthebob00
0 Asked on February 5, 2021 by pookie
1 Asked on February 4, 2021 by retsek680
1 Asked on February 3, 2021 by stark2022
0 Asked on February 1, 2021 by david-grnberger
0 Asked on January 30, 2021 by tzlil
0 Asked on January 29, 2021 by angelic-demonic
Get help from others!
Recent Questions
Recent Answers
© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP