Connect the dots game solver

95 次查看(过去 30 天)
Ahmed
Ahmed 2023-8-8
回答: Kenna 2024-2-19
I currently have a cell array of size Nx2, where in the first column of the cell array I have an array of size Mx2. in this array I have M points for the connect the dots game and the 2 signals the x and y coordinates of each point, this array has the points randomized (so connecting them in the given order doesn’t solve the game), in the corresponding cell I have the solution to this connect the dots problem where the rows are ordered to complete the connect the dots game (as you can see In the attached image, the shape doesn’t intersect itself and the final point is the starting point)
I would like to train a model using my N samples of solutions to be able to take any future connect the dots arrays (no matter the shape) and be able to order the points to solve the game. Any suggestions of recommendations is appreciated.

回答(2 个)

Anurag
Anurag 2023-8-24
As per my understanding of your problem, I see that given a column of points (x,y coordinates) in a randomised order corresponding to the order in which they are to be connected, you wish to develop a ML model to predict the correct ordering of the coordinates when fed with new points.
This problem deals with the sequence ordering problem where we want to predict the correct order of points to solve the game.
Due to it being a sequence prediction problem, you need to use a Recurrent Neural Network (RNN) or Long Short-Term Memory (LSTM) networks since these models are designed to work with sequential data.
  • Flatten the M x 2 array of points into a 1D array for each sample.
  • This transformation would result in N sequences of points.
  • These sequences of points can be utilized to train an RNN/LSTM model.
  • The RNN/LSTM model takes sequences of point coordinates as input.
  • The model's goal is to predict the correct order of indices as output.
  • The model architecture could include:
An embedding layer for the input points.
One or more LSTM layers after the embedding.
An output layer that predicts the indices of the point order.
Hope this helps!

Kenna
Kenna 2024-2-19
You could consider training a model using your N samples of solutions to predict the correct order of points in future connect-the-dots arrays. This task is akin to solving a complex puzzle, similar to the challenge presented by the rice purity test where one must carefully navigate through various scenarios to achieve the desired outcome.

类别

Help CenterFile Exchange 中查找有关 Video games 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by