Ah ah Thank you!

To make easily understandable;

I have implemented A* Pathfinding Algorithm in typescript.

So I have a matrix with 0 for walkable, 1 for not walkable.

I define 1 start position [Ax, Ay], and an array with multiple goals position [[Bx,By], [Cx,Cy] …].

I get the distance and the path between/from A to B, A to C and I take the smallest one.

I push the smallest path in an array called "myPath"

Then I get the path from (for exemple if A to B was the smallest one) B to C and I push the path into “myPath”

So at the end,

I have my matrix with 0 and 1

I have my path from A to C passing through B : [ [A -> B] , [B -> C] ] ==> [ [ [Ax, Ay], [0,1], [0,2], [Bx, By] ] ,

[ [Bx, By], [0,4 ], [0,5], [Cx, Cy] ]

I’d like to modelize my matrix with whites and blacks squares and to modelize my path with greens squares

I hope you have understood everything because I don’t speak english very well!

Bye!