A perfect ruler of length is a ruler with integer markings , for which there exists an integer such that any positive integer is uniquely expressed as the difference for some . This is referred to as an -perfect ruler.
An optimal perfect ruler is one of the smallest length for fixed values of and .