If there is no requirement for adjacent spaces in some rooms?

Hi,all.
I am studying some cases of spatial layout and encountered a problem:
If there is no requirement for adjacent space in some rooms, how to enter this null value data to ensure that no error is reported?
image

You can try using a 0 or a really big number. When it comes time to grab the non-existent adjacent space a Function.Apply method should prevent the warning.