stop times edge algorithm