I'm designing a procedural city generator, and the first step of the generation process is the creation of city streets. These streets extend out in a straight line to a point, then they can either branch, rotate, or continue in the same direction. If a street would hit another street, it can either stop growing or attach to the nearest junction.
I've been thinking of the junctions as vertices and the streets as edges. From this, I should be able to break the network up into a collection of the smallest possible polygons -- i.e., a space enclosed on all sides by streets.
Dead-end streets can intrude into a polygon, but if a street has 2 junctions on either side, I would like to have that as the edge of a polygon. I can easily remove streets that are "dead ends" (vertices that only have one edge attaching to them) from consideration before processing, so they're not an issue.
So given a collection of vertices and edges, what is a good way to break them up into the smallest possible polygons? It doesn't matter if the polygon is convex or concave, as it would primarily be used as a way to load in bits of the city and mark an area as loaded or unloaded and selectively choose bits of the city for simulation.