Click here to Skip to main content
15,885,875 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Quote:
The object of this puzzle is to place the largest possible number of coins at
points of the eight-pointed star depicted in Figure 2.9. The coins should be
placed one after another, with the following restrictions: (i) a coin needs
to be placed first on an unoccupied point and then moved along a line to
another unoccupied point, and (ii) once a coin has been positioned in this
manner, it cannot be moved again. For example, we can start by placing the
first coin on point 6 and then moving it to point 1 (denoted 6 → 1), where
the coin will have to remain. We can continue, say, with the following
sequence of moves: 7 → 2, 8 → 3, 7 → 4, 8 → 5, which places five coin


What I have tried:

I was thinking about using the dictionary in python but i dont know to put it in this problem
Posted
Updated 22-Aug-17 20:05pm
v3

1 solution

"How do I can solve the problem coins on a star" ...

Firstly you do some research: Google[^]
From the 2nd link on that search I learn that the problem can be solved using the "greedy strategy" or the "buttons and strings" method.

Then I can find all sorts of information on the Greedy Strategy Algorithm[^]

Not so much for Buttons and Strings[^] but still enough to go on.

Don't forget to follow the constraints listed in the assignment - which are giving some indication of which method to choose.

Once you have decided the "how" to do it, write some code to actually achieve the solution. If you get into problems with your code then come back with that code and we will try to help.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900