automatic tracking and labeling of human activities in a video sequence .
Introduction to Algorithms, Second Edition