Solving the median problem with continuous demand on a network