I created the code below to generate a matrix (m) with two columns (edgeStart and edgeEnd) that contain 100 random integers each. These integers are the "nodes" and each "edge" is a tuple of two distinct nodes. The start nodes are in the first column, and the end nodes are in the second column. Right now, each start node corresponds to only one end node (ie. there are 100 nodes with 100 edges between them). Is there a way to create more edges (ie. with 100 nodes, have about 250 edges between them)?
clear alledgeStart = zeros(100,1);for nodeStart = 1:100 edgeStart(nodeStart) = ceil(100.*rand(1)); edgeStart = edgeStart';endedgeEnd = zeros(100,1);for nodeEnd = 1:100 edgeEnd(nodeEnd) = ceil(100.*rand(1)); edgeEnd = edgeEnd';endm = [edgeStart,edgeEnd];csvwrite('csvtest.csv',m)type csvtest.csv
Best Answer