A generalized Pólya's urn with graph based interactions