next up previous contents
Next: Merging Census and Electoral Up: plvdkey.exe : Creating MCD-groups Previous: The .mgs File

MCD Group-Creation Algorithm

The problem of finding geographic correspondence between MCDs and precincts to create the MCD Groups is several-fold, owing to the numerous possibilities hampering the boundary correspondence of these units.

  1. An MCD could contain numerous precincts.
  2. A precinct could contain more than one MCD (although this is rare).
  3. A single precinct could overlap one or more MCDs.
  4. A single MCD could overlap one or more precincts.

Both of the last two types of non-correspondence are common. For example, an MCD Group might contain three precincts which exhaustively and exclusively ``tile'' the area of the MCD Group. This should result in the creation of a single MCD Group containing one MCD and three precincts. However, let us suppose one of the three precincts overlapped the border of an adjacent MCD, so that they no longer filled the first MCD exclusively. Then this second MCD would have to be added to the MCD Group, as well as all of the precincts it contained. Furthermore, if any of the second MCDs precincts overlapped into another adjacent MCD, then it would be added to the MCD Group, as well as its precincts, which would have to be checked, and so on. When precinct and MCD boundaries do not correspond at all, the MCD Group grows to the county size, encompassing all of its county's MCDs and precincts. In practice, however, nearly every state had some counties that contained multiple MCD Groups.

The algorithm for mapping MCD Groups from the existing geography proceeds much along the lines of the above discussion. After the exception counties have been assigned an MCD Group number, the procedure searches the geography using the following recursive procedure:

0.
Get the list of MCDs and precincts sorted by precinct. Add a field of all zeros for MCD Group.
1.
Cycle through the list looking for series of the same precinct numbers. (This happens when a precinct overlaps multiple MCDs).
2.
When a precinct series (2 or more) is found, check the values of the MCD Group-number field.  
2a.
Are all of the MCD Group-numbers for the series already assigned (non-zero)?
YES:
Skip the whole series, since it was previously assigned by recursion.
NO:
Go to step 2b.

2b.
Are all of MCD Group-numbers for the series UNassigned?  
YES:
Exit, since something must be broken. Series of precincts should always be dealt with together.
NO:
Good, proceed to step 3.

3.
Increment the MCD Group-number counter (which keeps track of the next value to assign to an MCD Group), since we are now dealing with a new MCD Group.  
4.
For each item in the series:  
4a.
Assign its MCD Group field the current MCD Group-number.
4b.
Send its MCD number to the MCD-recursive search process (see below).  

5.
Continue cycling through the list as we began in step 1 until finished.

The key to this procedure is Step 4b. The MCD-recursive procedure takes the list, with the current state of its MCD Group-number assignments, and a single MCD number. It starts at the top of this list, and cycles through it looking for precincts that both a) have the same MCD-number and b) have not yet been assigned an MCD Group-number. When such a precinct is found, the procedure assigns the current MCD Group-number to the precinct, and then calls the precinct analog of the precinct-recursive procedure. This works in just the same way as the MCD-recursive procedure, taking the current state of the entire list, and a single precinct number. It cycles through the list looking for unassigned precincts that match its precinct-number argument, assigning them the current MCD Group-number.

Whenever the precinct-recursive function makes an assignment, however, it calls the MCD-recursive procedure using that precinct's MCD-number as the argument. (Recall that the MCD-recursive procedure called the now calling precinct function in the first place). This procedure of searching for overlapping MCDs and then precincts goes back and forth until no unassigned MCD Group-numbers can be found that match the MCD- or precinct- numbers sent to the recursive functions. In other words, the recursive calls end when the MCD Group fields become filled through previous assignment, and the recursive checking for overlaps ends because no more matching MCDs or precincts are found that have not already been assigned. When this happens the recursive series terminates and the algorithm continues, having completed Step 4b.

More detailed documentation may be found in the source code itself, which is included with the data.


next up previous contents
Next: Merging Census and Electoral Up: plvdkey.exe : Creating MCD-groups Previous: The .mgs File
Copyright © 1997-2004 [ROAD Home] Questions? Contact the ROAD webmaster.