Connect the dots game solver

조회 수: 90 (최근 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.
  댓글 수: 1
Dyuman Joshi
Dyuman Joshi 2023년 8월 9일
What exactly do you need help with?

댓글을 달려면 로그인하십시오.

답변 (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