Suff like this is part of the so called Room Schedules Tables. Owner provides Adj Matrices either in binary (0/1) or in range of values (0/10…100) format. Architects occasionally “modify” slightly these if they have enough experience and owner trusts them and accepts advisory. Adj Matrices are critical if you design a “special” building where space connections are paramount like a Hospital, a Plant, a Research Institute etc etc . If there’s some BID procedure these play a critical role for evaluating/rating the candidate solution.
But just for the challenge of it you can do some random Matrices (see Tip) and query spaces accordingly. So for each space you’ll need a rational (I do hope) “portion” of a similar Matrix (or Matrices): that becomes just another Property of some space/room in the builInfo List.
Added another challenge/Tip as well:
Buildings_BuildInfoClassDemo_V1B.gh (127.0 KB)
Added a 4th Query as well (mostly because some people are afraid to Group first and then Order things). The 5th option is for you when you are ready.