basic weighted graph api