Shortest path between any origin to any destination through some way stations

How can one find the shortest path between any one of the origins to any one of the destinations through a number of way stations on the way using Dijkstra algorithm?

You can visit those way stations in any order. There will be multiple origins and multiple destinations, but a path from any origin to any destination will suffice as long as it’s the shortest.