create weighted graphs