Boundary Detection Algorithm Inspired by Locally Linear Embedding