The Hosoya polynomial of double weighted graphs