First I am not sure which keywords to use for this and I think I am probably using the wrong ones to google about it, so if someone could give me any hint it would be much appreciated.
My problem is the following:
I need to find the “rooms” inside a house plan. For example take this geometry:

The desired algorithm would tell me which vertexes bound each of the rooms. So for this example it would be:
- room A: 1, 2, 9, 10, 3, 4, 5, 8 ,1
- room B: 2, 3, 10, 9, 2
- room C: 11, 12, 14, 13, 11
- room D: 5, 6, 7, 8, 5
I have the vertexes and the edges as input data.
Edit:
The edge data is as follows (edge 8, 1 ,2):
x y
47 196
47 85
258 85
it is in pixel coord.
Graph Theory did not really help me because I have disconnected loops that share information. For example [1 2 9 10 3 4 5 8 1] AND [11 12 14 13 11]. So in the end I ended up doing a image fill, when expanding the boarders of the fill 1 pixel and doing a boolen operation to figure out which vertex are inside the filled image.