Let p1, p2, . . . , pn be n points on the plane. We have m rules of form pi rel pj , each inform us that the relation rel holds among the locations of points pi and pj on the plane. For example, “pi NE pj” indicates that point pj is located NorthEast of point pi. There are eight different relations {N, E, S, W, NE, NW, SE, SW}, corresponding to the eight directions on the plane. Let (xi, yi) and (xj , yj) be the coordinates of pi, and pj respectively. Then pi rel pj exactly means one of the following, depending on the value of rel:
- N stands for North. This means that xj = xi and yj > yi,
- E stands for East. This means that xj > xi and yj = yi,
- S stands for South. This means that xj = xi and yj < yi,
- W stands for West. This means that xj < xi and yj = yi,
- NE stands for NorthEast. This means that xj > xi and yj > yi,
- NW stands for NorthWest. This means that xj < xi and yj > yi,
- SE stands for SouthEast. This means that xj > xi and yj < yi, and
- SW stands for SouthWest. This means that xj < xi and yj < yi.
The problem is to determine whether it possible to locate p1, p2, . . . , pn on the plane so that all
given rules are satisfied.