Similarity of vertex cosine on a graph

With a set of edges, how can the contiguity matrix of these edges be filled with the cosine similarity measure of each pair of vertices? Consider this edge set:

edges = {TX -> R1, R1 → R3, R3 → R5, R5 → RX, TX → R2, R2 → R4,
R4 → R6, R6 → RX, R1 → R2, R2 → R3, R3 → R4, R4 → R5, R5 →
R6, TX -> R7, TX -> R8, R7 → R9, R9 → R6, R9 → RX, R8 → R6