Java A Pathfinding Algorithm Finding A Path But Not Optimal Best

Java A Pathfinding Algorithm Finding A Path But Not Optimal Best