Inverse problems on graphs: recovering the tree of strings by the BC-method