I'm a second year physics undergraduate student and a novice to programming and to Mathematica. I've started self studying graph theory some months ago and I'm getting acquainted with it and how to use Mathematica to work with graphs.
One of the problems I'm trying solve is how to code the operations for merging non disjoint graphs, using their adjacency matrices, for example, if I have these adjacency matrices:
I realized that one way to create the joint adjacency matrix was to first dispose de matrices on the diagonal of a 9x9 matrix, like (1) and then transferring the values of the repeated columns to the first columns where that vertex appeared and finally deleting the duplicated columns, thus generating a matrix like (2), which in turn allows me to use functions like
AdjacencyGraph to create the intended graph.
These operations are relatively simple to perform on a spreadsheet software like Excel, but I found out that I couldn't crack how to do it on Mathematica, even though I know how to do the basic linear algebra and matrix algebra in the Wolfram Language.
I know that this is probably not the kind of answer this community is intended to have, but I don't know anywhere else to ask for help.
Thanks in advance,