User:StudentEngineering826/sandbox

$$ AB$$ and $$ ABA$$ graphs are mathematical structures which are constructed from scripts of dramas. These graphs are used to represents the social structures of the drama. The vertices of the $$ AB$$ and $$ ABA$$ graphs are characters who share an interaction with other characters in the social network of the drama. The definition of such an interaction depends on the type of the graph. To form the graphs, an edge is placed between any two vertices that share an interaction. $$ AB$$ and $$ ABA$$ graphs are used to analyze the behavior of social networks or individuals in it, as well as proving a variety of theories concerning the patterns observed in these structures.

AB Graphs
AB graphs are formed from analyzing which social character speaks after which character in the network. The vertices of the graph represent the characters. An edge is placed between characters who speak after one another. There are two independents characteristics that define $$ AB$$ graphs: whether the graph is directed or undirected, and whether the graph is weighted or unweighted. These characteristics form four different versions of the $$ AB$$ graph. A directed and weighted $$ AB$$ graph of a script $$ Sc=(sc_t)^\tau_{t=1}$$ with length $$ {\displaystyle \tau }$$ is a frequency graph which is defined by $$ {\displaystyle {\displaystyle AB(Sc)=(V,E,W_{f}=[f_{i,j}])}} $$ where: When the script in question is clear from the text, as is typically the case, it is denoted as $$ AB$$ instead of $$ AB(Sc)$$. The weighted undirected version is denoted as $$ ABU$$, the simple unweighted undirected version as $$ ABS$$, and the unweighted directed version as $$ {ABUD} $$. There is an assumption that $$ V(AB(S{c}))$$ are sorted alphabetically.
 * 1) $${\displaystyle {\displaystyle V(AB(Sc))=\bigcup _{i=1}^{\tau }{ \{c_{i}\} }}}$$ is the vertex set of the graph
 * 2) $$ {\displaystyle {\displaystyle E(AB(Sc))=\bigcup _{i=1}^{\tau -1}{\{(c_{i},c_{i+1})}}\}}$$ is the edge set of the graph
 * 3) $${\displaystyle W_{f}(AB(Sc))=[f_{i,j}]}$$ is the weighted adjacency matrix of the graph where $$ {\displaystyle f_{i,j}=|{\{k\in \mathbb {N} :c_{k}=v_{i},c_{k+1}=v_{j},1\leq k\leq \tau -1}\}|}$$ for all $${\displaystyle v_{i},v_{j}\in V(AB(Sc))}$$

ABA Graphs
An $$ ABA$$ graph contains an edge going from $$ A$$ to $$ B$$ if $$ A$$ speaks to $$ B$$, then $$ B$$ replies to $$ A$$, and then $$ A$$ speaks again after $$ B$$.

Definition:
Let $$ Sc$$ be a script with length $$ \tau$$. The $$ ABA$$ graph $$ ABA(Sc)$$ of the script $$ Sc$$ is a frequency graph. In particular, $$ ABA(Sc)$$ is a graph where: The notations used here are similar to those used in the AB graph. When the script in question is clear from the text, as is typically the case, it is denoted as $$ ABA$$ instead of $$ ABA(Sc)$$. The ABA graph also has four different versions. The weighted undirected version is denoted as $$ ABAU$$, the simple unweighted undirected version as $$ ABAS$$, and the unweighted directed version as $$ ABAUD$$. It is assumed that the vertices of the ABA graph are sorted alphabetically. The nodes of $$ ABA$$ are the same as $$ AB$$ because of the way that these graphs are define. It is useful to delete nodes with a degree of zero, since there aren't any edges connected to those nodes.
 * 1) The vertex set is $$V(A B A(Sc))=\bigcup_{i=1}^\tau{\{c_i\}}$$
 * 2) The set of edges is $$E(ABA(Sc))={\{(c_i,c_{i+1})\in E(AB(Sc)): c_i = c_{i+2}, 1\leq i \leq \tau-2\}}$$
 * 3) The weighted adjacency matrix $$W_f(ABA(Sc))=[f_{i,j}]$$ where$$f_{i,j}=\left\vert {\{k \in \Nu : c_k = v_i, c_{k+1} =v_j ,c_{k+2}=v_i, 1\leq k \leq \tau -2 \} } \right\vert$$

ABA Subgraph of AB
An $$ ABA$$ can be interpreted as a subgraph of the $$ AB$$ graph. It is possible to think of the $$ ABA$$ graph as being generated from the $$ AB$$ graph by deleting edges which represent short conversations. In fact, the type of relationship between the $$ AB$$ and $$ ABA$$ graphs demonstrates an important concept in graph theory. Lemma: For all script $$Sc$$: $$ABA(Sc)\subset AB(Sc)$$

Proof:
By definition, all the nodes in the $$ ABA$$ graphs are also nodes in the $$ AB$$ graph. Therefore, to prove the lemma, we just need to show that all edges $$ E(ABA(Sc))$$ of the graph $$ ABA(Sc)$$ are also edges $$ E(AB(Sc))$$ of the graph $$ AB(Sc)$$. According to the definition of $$ ABA(Sc)$$, if we take an edge $$ e'= (v_{i}, v_{j}) \in E(ABA(Sc)) $$, then it follows that there exists an index response $$ k \in \mathbb {N} ,\tau-2$$ such that $$ c_k = v_i, c_{k+1} = v _j, c_{k+2} = v_i$$. We now consider the graph $$ AB$$ by looking at the script at time $$ k $$ and time $$ k + 1$$. It follows from the definition of the graph $$ AB$$ that the edges are $$ (v_i,v_j)\in E$$. Moreover, for each instance of $$ e $$ in the graph $$ ABA(Sc)$$, we find an instance of the edge $$ e $$ in the graph $$ AB(Sc)$$. As a result, we get that $$ W(ABA)_{i,j}\leq W(AB)_{i',j'}$$.

AB and ABA Graphs as approximation of the WW Graph
The "Who spoke after whom" graph (denoted WW) represents who spoke to whom. The AB graph represents who spoke after who. Surprisingly, the $$ ABA$$ graph approximates the “Who spoke after whom” graph with decent accuracy. The accuracy can be improved by looking at the $$ ABA$$ graph that represents longer conversations between two characters.