Hard-wiring this may not be the best solution. After all, one can still define nodes in a RAG to be "at border" if the are adjacent to the infinite region. If this makes sense depends on the application.