How to update part of an A* grid

So I have been watching these tutorials how how to use A* for pathfinding but I was wondering to you update just part of the grid because when the player opens a door I don’t want to remake the whole grid as that would cause a lot of lag and be very inefficient.

A* on its own doesn’t do well with changes to the environment or following a moving destination, but it’s a good base to start with.

There’s another algorithm called Dynamic A*, or D*, that will adapt more easily to a changing environment by calculating from the end to the start instead of start to end, keeping all the calculation data and using waves of “raise” & “lower”. It uses more data in exchange for greater flexibility. D* isn’t very good for following a moving destination either though…

I can’t completely explain all of how D* works in this text box, but the point is that A* is a starting point from which you can apply a variety of modifications and optimizations to match your game and how it plays.

In a small world, or when calculating over a small area, regular A* without modifications can be the more efficient option too. Sometimes holding on to data to try not to be wasteful winds up taking more CPU cycles than throwing it out & recalculating. It really all depends on a variety of specifics.