Connect the dots game solver

90 visualizaciones (últimos 30 días)
Ahmed
Ahmed el 8 de Ag. de 2023
Respondida: Kenna el 19 de Feb. de 2024
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.
  1 comentario
Dyuman Joshi
Dyuman Joshi el 9 de Ag. de 2023
What exactly do you need help with?

Iniciar sesión para comentar.

Respuestas (2)

Anurag
Anurag el 24 de Ag. de 2023
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 el 19 de Feb. de 2024
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.

Categorías

Más información sobre Video games en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by