Swiss scientists have developed an algorithm for automated vehicles that will allow them to operate in traffic alongside manually-driven cars.