add nodes with double[] or int[] weights
adds edges with double[] or int[] weights