How we can have one origin and multiple destinations in google map api

view story

http://stackoverflow.com – I am working on a project which uses google maps api's. I have one origin and set of destinations. I have to select that destination which has least distance and duration from the origin. I have tried to use distance matrix bt it was not working fine. (HowTos)