Hi everyone. To put it very briefly, I have data on different individuals and their connections with other individuals of a given network. In my data, an individual can either :

1) Be connected to one or more individuals, in which case there will be an observation for each connection
2) Remain without any connection, in which case there will be one observation, but with missing data for the different variables var1, var2, var3... that give information on the connections.

My request is quite simple but I can't figure it out with my code. I would like to have a dataset with n*n observations, with all the possible pairs of individuals possible and a dummy variable equal to 1 if there is a connection between the two individuals. Here is a sample of my data:

Code:
* Example generated by -dataex-. For more info, type help dataex
clear
input str3(source target) str2(freq1 freq_2) str4 time
"A1"  ""    ""  ""  ""  
"A10" ""    ""  ""  ""  
"A11" ""    ""  ""  ""  
"A12" ""    ""  ""  ""  
"A13" "A4"  "1" "2" "12"
"A13" "A14" "1" "3" "12"
"A13" "A3"  "1" "1" "12"
"A13" "A8"  "5" "1" "12"
"A13" "A15" "5" "1" "12"
"A13" "A18" "2" "5" "18"
end
individuals A1, A10, A11 and A12 do not have connections. A13 does have connections, and the individuals he is connected with each represent one line. Assume there are 18 individuals in my dataset. Basically I would like 18*18 observations and 18 missing lines for A1, 18 missing lines for A10, 12 missing lines for A13, etc.

Can someone help me figure this problem out?