SHARE
TWEET

GraphsDataSets.jl

BenjaminLind May 10th, 2014 415 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #####
  2. ### Network datasets for the Julia language
  3. ### Implemented using the Graphs library
  4. ### Layouts from Fruchterman-Reingold algorithm calculated in igraph
  5. #####
  6.  
  7. ### To load these datasets, enter:
  8. # download("http://pastebin.com/raw.php?i=Z2t7XRd3", "GraphsPopularDataSets.jl"); include("GraphsPopularDataSets.jl"); rm("GraphsPopularDataSets.jl")
  9.  
  10. # These lines will provide convenience functions to read the datasets as type GenericGraph
  11. download("http://pastebin.com/raw.php?i=hcRJmCPH", "GraphsLibHelperFunctions.jl")
  12. include("GraphsLibHelperFunctions.jl")
  13. rm("GraphsLibHelperFunctions.jl")
  14.  
  15. ###
  16. # Padgett's Florentine family marriage network
  17. # Padgett, John F. (1994). “Marriage and Elite Structure in Renaissance Florence, 1282-1500.” Paper delivered to the Social Science History Association.
  18. ###
  19.  
  20. flograph = Array(String, 20, 2)
  21. flograph[1,:] = ["Acciaiuoli", "Medici"]
  22. flograph[2,:] = ["Albizzi", "Ginori"]
  23. flograph[3,:] = ["Albizzi", "Guadagni"]
  24. flograph[4,:] = ["Albizzi", "Medici"]
  25. flograph[5,:] = ["Barbadori", "Castellani"]
  26. flograph[6,:] = ["Barbadori", "Medici"]
  27. flograph[7,:] = ["Bischeri", "Guadagni"]
  28. flograph[8,:] = ["Bischeri", "Peruzzi"]
  29. flograph[9,:] = ["Bischeri", "Strozzi"]
  30. flograph[10,:] = ["Castellani", "Peruzzi"]
  31. flograph[11,:] = ["Castellani", "Strozzi"]
  32. flograph[12,:] = ["Guadagni", "Lamberteschi"]
  33. flograph[13,:] = ["Guadagni", "Tornabuoni"]
  34. flograph[14,:] = ["Medici", "Ridolfi"]
  35. flograph[15,:] = ["Medici", "Salviati"]
  36. flograph[16,:] = ["Medici", "Tornabuoni"]
  37. flograph[17,:] = ["Pazzi", "Salviati"]
  38. flograph[18,:] = ["Peruzzi", "Strozzi"]
  39. flograph[19,:] = ["Ridolfi", "Strozzi"]
  40. flograph[20,:] = ["Ridolfi", "Tornabuoni"]
  41.  
  42. flograph = el_2_graph(flograph, directed = false, vtype = ExVertex)
  43. add_vertex!(flograph, ExVertex(16, "Pucci"))
  44. flograph = set_vertex_attribute(flograph, "x", [-13.846888, -17.775591, -5.107852, -11.752655, -3.598364, -22.077410, -13.846888, -17.775591,  -5.107852, -11.752655, -3.598364, -9.896108, -7.809358, -7.646157, -13.928437, -22.077410], 1:num_vertices(flograph))
  45. flograph = set_vertex_attribute(flograph, "y", [-1.485216, 4.937994, 6.317159, 14.894765, 11.768862, 2.730860, 10.853485, 12.443702, 3.411225, -2.113091, 16.043512, 8.167267, -0.776357, 12.912044, 7.376778, 20.355235], 1:num_vertices(flograph))
  46.  
  47. ###
  48. # Coleman's high school children data.
  49. # Fall term.
  50. # Coleman, James S. (1964). _Introduction to Mathematical Sociology._ New York: Free Press.
  51. ###
  52.  
  53. colemangraph = Array(Int, 243, 2)
  54. colemangraph[1, :] = [1, 14]
  55. colemangraph[2, :] = [1, 15]
  56. colemangraph[3, :] = [1, 21]
  57. colemangraph[4, :] = [1, 54]
  58. colemangraph[5, :] = [1, 55]
  59. colemangraph[6, :] = [2, 21]
  60. colemangraph[7, :] = [2, 22]
  61. colemangraph[8, :] = [3, 9 ]
  62. colemangraph[9, :] = [3, 15]
  63. colemangraph[10, :] = [4, 5 ]
  64. colemangraph[11, :] = [4, 18]
  65. colemangraph[12, :] = [4, 19]
  66. colemangraph[13, :] = [4, 43]
  67. colemangraph[14, :] = [5, 19]
  68. colemangraph[15, :] = [5, 43]
  69. colemangraph[16, :] = [6, 13]
  70. colemangraph[17, :] = [6, 20]
  71. colemangraph[18, :] = [6, 22]
  72. colemangraph[19, :] = [7, 17]
  73. colemangraph[20, :] = [8, 14]
  74. colemangraph[21, :] = [8, 17]
  75. colemangraph[22, :] = [9, 12]
  76. colemangraph[23, :] = [9, 20]
  77. colemangraph[24, :] = [9, 21]
  78. colemangraph[25, :] = [9, 22]
  79. colemangraph[26, :] = [9, 51]
  80. colemangraph[27, :] = [11, 19]
  81. colemangraph[28, :] = [11, 50]
  82. colemangraph[29, :] = [11, 52]
  83. colemangraph[30, :] = [11, 53]
  84. colemangraph[31, :] = [12, 20]
  85. colemangraph[32, :] = [12, 21]
  86. colemangraph[33, :] = [12, 22]
  87. colemangraph[34, :] = [13, 17]
  88. colemangraph[35, :] = [13, 20]
  89. colemangraph[36, :] = [13, 21]
  90. colemangraph[37, :] = [13, 22]
  91. colemangraph[38, :] = [14, 21]
  92. colemangraph[39, :] = [14, 22]
  93. colemangraph[40, :] = [15, 20]
  94. colemangraph[41, :] = [16, 18]
  95. colemangraph[42, :] = [16, 41]
  96. colemangraph[43, :] = [16, 43]
  97. colemangraph[44, :] = [17, 7 ]
  98. colemangraph[45, :] = [17, 8 ]
  99. colemangraph[46, :] = [18, 11]
  100. colemangraph[47, :] = [18, 16]
  101. colemangraph[48, :] = [18, 19]
  102. colemangraph[49, :] = [19, 4 ]
  103. colemangraph[50, :] = [19, 11]
  104. colemangraph[51, :] = [19, 16]
  105. colemangraph[52, :] = [19, 18]
  106. colemangraph[53, :] = [19, 27]
  107. colemangraph[54, :] = [20, 6]
  108. colemangraph[55, :] = [20, 12]
  109. colemangraph[56, :] = [20, 21]
  110. colemangraph[57, :] = [20, 22]
  111. colemangraph[58, :] = [20, 38]
  112. colemangraph[59, :] = [21, 22]
  113. colemangraph[60, :] = [21, 51]
  114. colemangraph[61, :] = [21, 54]
  115. colemangraph[62, :] = [21, 55]
  116. colemangraph[63, :] = [22, 20]
  117. colemangraph[64, :] = [22, 21]
  118. colemangraph[65, :] = [22, 38]
  119. colemangraph[66, :] = [22, 51]
  120. colemangraph[67, :] = [23, 40]
  121. colemangraph[68, :] = [23, 43]
  122. colemangraph[69, :] = [23, 50]
  123. colemangraph[70, :] = [23, 52]
  124. colemangraph[71, :] = [23, 53]
  125. colemangraph[72, :] = [23, 60]
  126. colemangraph[73, :] = [23, 62]
  127. colemangraph[74, :] = [23, 65]
  128. colemangraph[75, :] = [23, 68]
  129. colemangraph[76, :] = [24, 51]
  130. colemangraph[77, :] = [26, 32]
  131. colemangraph[78, :] = [26, 35]
  132. colemangraph[79, :] = [26, 36]
  133. colemangraph[80, :] = [26, 40]
  134. colemangraph[81, :] = [26, 41]
  135. colemangraph[82, :] = [26, 42]
  136. colemangraph[83, :] = [27, 18]
  137. colemangraph[84, :] = [27, 37]
  138. colemangraph[85, :] = [27, 40]
  139. colemangraph[86, :] = [28, 38]
  140. colemangraph[87, :] = [28, 39]
  141. colemangraph[88, :] = [29, 13]
  142. colemangraph[89, :] = [29, 38]
  143. colemangraph[90, :] = [30, 35]
  144. colemangraph[91, :] = [30, 48]
  145. colemangraph[92, :] = [31, 10]
  146. colemangraph[93, :] = [31, 37]
  147. colemangraph[94, :] = [31, 40]
  148. colemangraph[95, :] = [32, 26]
  149. colemangraph[96, :] = [32, 33]
  150. colemangraph[97, :] = [32, 43]
  151. colemangraph[98, :] = [32, 62]
  152. colemangraph[99, :] = [33, 36]
  153. colemangraph[100, :] = [33, 41]
  154. colemangraph[101, :] = [33, 42]
  155. colemangraph[102, :] = [33, 43]
  156. colemangraph[103, :] = [34, 39]
  157. colemangraph[104, :] = [34, 46]
  158. colemangraph[105, :] = [35, 30]
  159. colemangraph[106, :] = [35, 48]
  160. colemangraph[107, :] = [36, 32]
  161. colemangraph[108, :] = [36, 33]
  162. colemangraph[109, :] = [36, 42]
  163. colemangraph[110, :] = [36, 43]
  164. colemangraph[111, :] = [37, 31]
  165. colemangraph[112, :] = [37, 40]
  166. colemangraph[113, :] = [38, 21]
  167. colemangraph[114, :] = [38, 22]
  168. colemangraph[115, :] = [38, 51]
  169. colemangraph[116, :] = [38, 55]
  170. colemangraph[117, :] = [39, 28]
  171. colemangraph[118, :] = [39, 29]
  172. colemangraph[119, :] = [39, 34]
  173. colemangraph[120, :] = [39, 46]
  174. colemangraph[121, :] = [39, 59]
  175. colemangraph[122, :] = [40, 35]
  176. colemangraph[123, :] = [40, 37]
  177. colemangraph[124, :] = [41, 16]
  178. colemangraph[125, :] = [41, 42]
  179. colemangraph[126, :] = [41, 43]
  180. colemangraph[127, :] = [41, 68]
  181. colemangraph[128, :] = [42, 36]
  182. colemangraph[129, :] = [42, 41]
  183. colemangraph[130, :] = [42, 43]
  184. colemangraph[131, :] = [42, 68]
  185. colemangraph[132, :] = [43, 41]
  186. colemangraph[133, :] = [43, 42]
  187. colemangraph[134, :] = [43, 68]
  188. colemangraph[135, :] = [44, 47]
  189. colemangraph[136, :] = [45, 49]
  190. colemangraph[137, :] = [45, 54]
  191. colemangraph[138, :] = [45, 55]
  192. colemangraph[139, :] = [45, 57]
  193. colemangraph[140, :] = [45, 70]
  194. colemangraph[141, :] = [46, 34]
  195. colemangraph[142, :] = [46, 39]
  196. colemangraph[143, :] = [46, 54]
  197. colemangraph[144, :] = [46, 59]
  198. colemangraph[145, :] = [47, 44]
  199. colemangraph[146, :] = [47, 48]
  200. colemangraph[147, :] = [47, 52]
  201. colemangraph[148, :] = [47, 53]
  202. colemangraph[149, :] = [48, 30]
  203. colemangraph[150, :] = [48, 50]
  204. colemangraph[151, :] = [48, 52]
  205. colemangraph[152, :] = [48, 53]
  206. colemangraph[153, :] = [49, 54]
  207. colemangraph[154, :] = [49, 55]
  208. colemangraph[155, :] = [49, 70]
  209. colemangraph[156, :] = [49, 71]
  210. colemangraph[157, :] = [50, 47]
  211. colemangraph[158, :] = [50, 52]
  212. colemangraph[159, :] = [50, 53]
  213. colemangraph[160, :] = [50, 68]
  214. colemangraph[161, :] = [51, 21]
  215. colemangraph[162, :] = [51, 22]
  216. colemangraph[163, :] = [51, 70]
  217. colemangraph[164, :] = [52, 47]
  218. colemangraph[165, :] = [52, 48]
  219. colemangraph[166, :] = [52, 50]
  220. colemangraph[167, :] = [52, 53]
  221. colemangraph[168, :] = [52, 68]
  222. colemangraph[169, :] = [53, 50]
  223. colemangraph[170, :] = [53, 52]
  224. colemangraph[171, :] = [54, 45]
  225. colemangraph[172, :] = [54, 49]
  226. colemangraph[173, :] = [54, 55]
  227. colemangraph[174, :] = [54, 63]
  228. colemangraph[175, :] = [54, 69]
  229. colemangraph[176, :] = [54, 71]
  230. colemangraph[177, :] = [55, 45]
  231. colemangraph[178, :] = [55, 49]
  232. colemangraph[179, :] = [55, 54]
  233. colemangraph[180, :] = [56, 64]
  234. colemangraph[181, :] = [56, 70]
  235. colemangraph[182, :] = [56, 71]
  236. colemangraph[183, :] = [57, 45]
  237. colemangraph[184, :] = [57, 49]
  238. colemangraph[185, :] = [57, 55]
  239. colemangraph[186, :] = [57, 66]
  240. colemangraph[187, :] = [57, 70]
  241. colemangraph[188, :] = [57, 71]
  242. colemangraph[189, :] = [58, 61]
  243. colemangraph[190, :] = [58, 65]
  244. colemangraph[191, :] = [59, 39]
  245. colemangraph[192, :] = [59, 54]
  246. colemangraph[193, :] = [59, 55]
  247. colemangraph[194, :] = [60, 58]
  248. colemangraph[195, :] = [60, 61]
  249. colemangraph[196, :] = [60, 62]
  250. colemangraph[197, :] = [60, 65]
  251. colemangraph[198, :] = [61, 58]
  252. colemangraph[199, :] = [61, 65]
  253. colemangraph[200, :] = [62, 60]
  254. colemangraph[201, :] = [62, 65]
  255. colemangraph[202, :] = [63, 66]
  256. colemangraph[203, :] = [63, 67]
  257. colemangraph[204, :] = [63, 69]
  258. colemangraph[205, :] = [63, 70]
  259. colemangraph[206, :] = [63, 71]
  260. colemangraph[207, :] = [64, 66]
  261. colemangraph[208, :] = [64, 67]
  262. colemangraph[209, :] = [64, 69]
  263. colemangraph[210, :] = [64, 71]
  264. colemangraph[211, :] = [65, 60]
  265. colemangraph[212, :] = [65, 62]
  266. colemangraph[213, :] = [65, 68]
  267. colemangraph[214, :] = [66, 64]
  268. colemangraph[215, :] = [66, 67]
  269. colemangraph[216, :] = [66, 69]
  270. colemangraph[217, :] = [66, 70]
  271. colemangraph[218, :] = [66, 71]
  272. colemangraph[219, :] = [67, 63]
  273. colemangraph[220, :] = [67, 64]
  274. colemangraph[221, :] = [67, 66]
  275. colemangraph[222, :] = [67, 69]
  276. colemangraph[223, :] = [67, 71]
  277. colemangraph[224, :] = [68, 31]
  278. colemangraph[225, :] = [68, 61]
  279. colemangraph[226, :] = [68, 62]
  280. colemangraph[227, :] = [68, 65]
  281. colemangraph[228, :] = [69, 63]
  282. colemangraph[229, :] = [69, 64]
  283. colemangraph[230, :] = [69, 66]
  284. colemangraph[231, :] = [69, 67]
  285. colemangraph[232, :] = [69, 71]
  286. colemangraph[233, :] = [70, 63]
  287. colemangraph[234, :] = [70, 66]
  288. colemangraph[235, :] = [70, 67]
  289. colemangraph[236, :] = [70, 69]
  290. colemangraph[237, :] = [70, 71]
  291. colemangraph[238, :] = [71, 63]
  292. colemangraph[239, :] = [71, 64]
  293. colemangraph[240, :] = [71, 66]
  294. colemangraph[241, :] = [71, 67]
  295. colemangraph[242, :] = [71, 69]
  296. colemangraph[243, :] = [71, 70]
  297. #Add "25", "72", "73" as isolates
  298.  
  299. colemangraph = el_2_graph(73, colemangraph, directed = true, vtype = ExVertex)
  300. colemangraph = set_vertex_attribute(colemangraph, "x", [1709.973, 1877.449, 1714.556, 1017.57, 1044.228, 1805.734, 1556.945, 1605.619, 1748.754, 1013.039, 1033.962, 1836.56, 1775.299, 1685.573, 1728.323, 1018.201, 1667.394, 1003.239, 1012.816, 1820.785, 1767.059, 1796.513, 1120.487, 1861.923, 1290.883, 1025.348, 1004.533, 1913.025, 1863.216, 1029.473, 1035.805, 1043.76, 1040.913, 1882.469, 1015.246, 1023.811, 1010.607, 1826.021, 1878.636, 1034.74, 1039.972, 1025.572, 1039.851, 1094.296, 1737.868, 1813.622, 1090.104, 1058.496, 1667.056, 1073.593, 1744.269, 1096.114, 1100.356, 1683.536, 1750.648, 1458.091, 1689.506, 1242.684, 1810.551, 1207.991, 1147.832, 1109.991, 1630.025, 1465.207, 1171.797, 1582.002, 1528.629, 1094.254, 1537.94, 1608.842, 1571.521, 1227.798, 1129.438], 1:num_vertices(colemangraph))
  301. colemangraph = set_vertex_attribute(colemangraph, "y", [-434.25152, -347.42788, -198.44388, -335.21881, -309.64132, -219.00008, -18.82689, -140.91743, -346.8776, -566.36328, -472.41893, -293.35131, -257.01903, -290.04603, -297.51174, -307.02262, -107.43507, -409.29297, -378.66385, -323.7143, -412.78065, -355.87108, -281.97625, -578.61235, -851.81685, -287.64669, -479.37924, -476.06577, -395.35986, -601.9131, -423.66263, -162.63372, -129.1195, -661.94443, -450.74731, -184.84312, -517.00691, -448.66719, -538.84513, -387.60252, -204.71862, -221.23332, -242.63024, -679.04223, -658.16306, -633.56098, -545.62324, -518.64951, -631.42972, -399.76948, -500.46786, -404.8807, -445.49073, -586.86981, -553.55888, -737.36771, -705.14021, -35.22947, -590.80854, -130.05731, -87.89909, -150.09928, -742.41184, -800.67362, -155.53407, -789.86632, -789.95114, -259.49112, -694.02514, -661.14969, -707.97442, -786.24791, -796.16129], 1:num_vertices(colemangraph))
RAW Paste Data
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top