How to implement an N-ary or K-ary tree to make the game 8-Puzzle with A *

0

How can I implement a tree that saves the father and the list of children in java I have done the following class to store the states. Is there a simple way to fill in the nodes with the possible states of the game 8-Puzzle?

public class Nodo {

    int value_FuncionF;
    int value_heuristica_H; // numero de casillas fuera de lugar
    int value_heuristica_costoG; //Cuato ha costado llegar a este nodo

    Nodo padre= null;

    private List<Nodo> hijos = null;


    String estado[][] = null;

    public Nodo() {}

    public Nodo(String nuevoEstado[][]) {
        this.estado = nuevoEstado;
    }

    public int getF() {
        return value_FuncionF;
    }

}
    
asked by Eduardo Tolentino 13.09.2018 в 07:14
source

0 answers