updated a star sot hat it doesnt compute cost functions by itself but uses the cost in the existing edges