main.tex (5711B)
1 \documentclass[a4paper]{article} 2 3 4 \usepackage[T1]{fontenc} 5 \usepackage[utf8]{inputenc} 6 \usepackage{mathptmx} 7 8 %\usepackage{ngerman} % Sprachanpassung Deutsch 9 10 \usepackage{graphicx} 11 \usepackage{geometry} 12 \geometry{a4paper, top=15mm} 13 14 \usepackage{subcaption} 15 \usepackage[shortlabels]{enumitem} 16 \usepackage{amssymb} 17 \usepackage{amsthm} 18 \usepackage{mathtools} 19 \usepackage{braket} 20 \usepackage{bbm} 21 \usepackage{graphicx} 22 \usepackage{float} 23 \usepackage{yhmath} 24 \usepackage{tikz} 25 \usetikzlibrary{patterns,decorations.pathmorphing,positioning} 26 \usetikzlibrary{calc,decorations.markings} 27 28 \usepackage[backend=biber, sorting=none]{biblatex} 29 \addbibresource{uni.bib} 30 31 \usepackage[framemethod=TikZ]{mdframed} 32 33 \tikzstyle{titlered} = 34 [draw=black, thick, fill=white,% 35 text=black, rectangle, 36 right, minimum height=.7cm] 37 38 39 \usepackage[colorlinks=true,naturalnames=true,plainpages=false,pdfpagelabels=true]{hyperref} 40 \usepackage[parfill]{parskip} 41 \usepackage{lipsum} 42 43 44 \usepackage{tcolorbox} 45 \tcbuselibrary{skins,breakable} 46 47 \pagestyle{myheadings} 48 49 \markright{Popović\hfill 1st Exercise \hfill} 50 51 52 \title{University of Vienna\\ Faculty of Mathematics\\ \vspace{1.25cm}Seminar: Introduction to complex network analysis \\ 1st 53 Exercise 54 } 55 \author{Milutin Popovic} 56 \date{19. October, 2021} 57 58 \begin{document} 59 \maketitle 60 61 \textbf{Exercise 1:} Discuss briefly advantages and disadvantages of 62 representing a network by 63 \begin{enumerate} 64 \item an edge list 65 \item an adjacency matrix. 66 \end{enumerate} 67 68 \textbf{Solution 1.1 Edge-list:} Advantages: Allows for compact representation of graphs (sparse 69 structure) to save a lot of Memory, deleting/adding connections/nodes is easier than 70 with a matrix representation. 71 \newline 72 Disadvantages: Might be slower to find out if a vertex/connection exists, 73 since matrix lookup time is constant. 74 75 \textbf{Solution 1.2 Adjacency Matrix:} Advantages: Constant lookup time. Easier to 76 change the entries of the matrix, thus modifying the network. 77 \newline 78 Disadvantages: Slow for iteration. 79 \newline 80 81 \textbf{Exercise 2:} Imagine that your social network has a subnetwork where 14 of your friends 82 together with you are all friends with each other. What is such a subnetwork 83 called? How many edges are contained in the subnetwork? 84 85 \textbf{Solution 2} 14 friends + 1 (me) = 15 people are all connected, such a 86 graph is called a complete graph, the number of vertices is given by 87 \begin{align} 88 L_{\text{max}} = \begin{pmatrix}15 \\ 2\end{pmatrix} = \frac{15(15-1)}{2} 89 = 105. 90 \end{align} 91 \newline 92 93 \textbf{Exercise 3:} 94 \begin{figure}[h!] \centering 95 \begin{tikzpicture}[ 96 dot/.style = {draw, circle, inner sep=0.02cm, thick}, 97 no/.style = {}, 98 ] 99 \node[dot](1) at (0,0) [] {1}; 100 \node[dot](2) at (1,0) [] {2}; 101 \node[dot](3) at (1,-1) [] {3}; 102 \node[dot](4) at (1,1) [] {4}; 103 \node[dot](5) at (2,0) [] {5}; 104 \node[dot](6) at (2,-1) [] {6}; 105 \node[dot](7) at (3,0) [] {7}; 106 \node[dot](8) at (4,1) [] {8}; 107 \node[dot](9) at (4,-1) [] {9}; 108 \node[dot](10) at (6, 0.5) [] {10}; 109 110 \draw[-, thick] (1) -- (2) -- (4); 111 \draw[-, thick] (2) -- (3) -- (6); 112 \draw[-, thick] (2) -- (5); 113 \draw[-, thick] (6) -- (5) -- (7) -- (8); 114 \draw[-, thick] (7) -- (9) -- (8); 115 \end{tikzpicture} 116 \caption{The graph from exercise 3} 117 \end{figure} 118 Consider the network above and 119 \begin{itemize} 120 \item Write down the adjacency matrix, 121 \item Write down the edge list. 122 \item Draw the degree distribution by hand. 123 \item Calculate the clustering coefficient, diameter and density. 124 \item Find the number of d=3 paths between 2 and 3. (you may use a computer) 125 \end{itemize} 126 127 \textbf{Solution 3:} The adjacency matrix is a $10x10$ matrix it can be 128 viewed in the `.ipynb' file. The edge - list is the following 129 \begin{align} 130 &(1, 2), \;\; (2 ,3), \;\; (2, 4), \;\; (2, 5), \;\; (3, 6), \;\; \nonumber\\ 131 &(5, 6), \;\; (5, 7), \;\; (7, 8), \;\; (7, 9), \;\; ( 8, 9). 132 \end{align} 133 For the clustering coefficient we obviously need to only consider node 7, 8 134 and 9, because no other neighbors for a given node are connected, thus we 135 have 136 \begin{align} 137 \langle C \rangle = \frac{1}{N}\sum_i^10 C_i = \frac{1}{10} (\frac{1}{3} 138 +2) = \frac{7}{30}. 139 \end{align} 140 The diameter $d_{\text{max}}$ is given by the length of the longest path 141 which is 142 \begin{align} 143 d_{\text{max}} = d_{1, 8} = d_{1, 9} = 4. 144 \end{align} 145 And finally for the graph density $\varrho$ we have number of vertices 146 divided by number of vertices of the complete graph 147 \begin{align} 148 \varrho = \frac{L}{\begin{pmatrix}L_{\text{max}} \\ 2\end{pmatrix}} = 149 \frac{2}{9}. 150 \end{align} 151 The number of $d=3$ paths between the nodes 2 and 3 are 152 \begin{align} 153 P_{2, 3} = \{(2, 5), (5, 6) , (6, 3)\}, 154 \end{align} 155 exactly one. For part (f) look at '.ipynb'. 156 \newline 157 158 \textbf{Exercise 4:} Consider a bipartite network with N1 and N2 nodes in the 159 two sets. 160 \begin{enumerate} 161 \item What is the maximum number of edges the network can have? 162 \item How many edges cannot occur compared with a non-bipartite network of size 163 \end{enumerate} 164 165 \textbf{Solution 4:} The maximum number of connection is when every node in 166 one network is connected to every node in the other network, meaning 167 \begin{align} 168 \underbrace{N_2 + N_2 + \cdots + N_2}_{N_1 \textbf{-times}} = N_1 \cdot 169 N_2. 170 \end{align} 171 The number of edges that cannot occur in compared to a normal network of size 172 $N = N_1 + N_2$ is 173 \begin{align} 174 \begin{pmatrix}N \\ 2 \end{pmatrix} - N_1N_2 &= \frac{(N_1 + N_2)(N_1+N_2 175 -1)}{2} - N_1N_2 =\\ &= \frac{1}{2} ( N_1^2 + N_2^2) - (N_1 + N_2). 176 \end{align} 177 178 \nocite{code} 179 \printbibliography 180 181 \end{document}