Given a database in matrix format:
SeedRandom[6]; mat = RandomInteger[5, {27, 30}]; mat[[1, All]] = {"", a1, a2, a3, a4, a5, b1, b2, b3, b4, b5, c1, c2, c3, c4, c5, d1, d2, d3, d4, d5, afd1, afd2, bfd1, bfd2, cfd1, cfd2, dfd1, dfd2, TD}; mat[[All, 1]] = {"", a1, a2, a3, a4, a5, b1, b2, b3, b4, b5, c1, c2, c3, c4, c5, d1, d2, d3, d4, d5, aT, bT, cT, dT, VA, TS};
Each row and column has a name, e.g., a1, a2, ...
. Suppose the following operations on mat
.
- Drop the columns
{a1, a3, b1, b2, c4, c5, d2, d5}
and the rows with the same names. - Create a weighted directed graph using the columns
{a2, a4, a5, b3, b4, b5, c1, c2, c3, d1, d3, d4}
and the rows with the same names.
My question is not about the operations referred to in [1] and [2]. I like to know how to keep the linkage between a string vertex name and a numeric vertex name. String names for the list in [2] are {a2, a4, a5, b3, b4, b5, c1, c2, c3, d1, d3, d4}
and the associated numeric names are {2, 4, 5, 8, 9, 10, 11, 12, 13, 16, 18, 19}
.
Because my original matrix is large, with the operation in item [1], I lose the linkage between numeric and string names, which I need in later stages of output formatting. For example, I can easily find Cliques
with numeric vertex names but I need to know the string names linked to the numeric vertices.
Any suggestion?