An algorithm for SDV representation of 2D behaviors