Any algorithm would be complex. Choose property damage over causing serious injury to an individual.
Minor bumps and bruises for the person inside vs risk of serious injury or death to the pedestrian.
The dilemma only becomes a problem when the alternative is serious injury or death to the occupant. Head-on. Plunge over a cliff, barrel into a solid wall, etc.
Ideally the vehicles will be programmed to not over-drive their own capabilities.