Create floorplan from rooms with specific number

you could try to get all the boundary vertices and apply some kind of alpha shape algorithm…see below: