If I understand your question right, you can simply remove the nodes where you want a wall (or another object).
So you can do something like this:
void addWall(int x, int y) {
graph.removeNode(x + y * 24);
}
Consider replacing โ24โ with a variable, so if you want to change the size of your game, you can do that by just changing the variable.
Anyway, I hope that helped 