Aptamers are single stranded DNA, RNA, or peptide sequences having the ability to bind several specific targets (proteins, molecules as well as ions). Therefore, aptamer production and selection for therapeutic and diagnostic applications is very challenging. Usually, they are generated in vitro, although computational approaches have been recently developed for the in silico production. Despite these efforts, the mechanism of aptamer-ligand formation is not completely clear, and producing high-affinity aptamers is still quite difficult. This paper aims to develop a computational model able to describe aptamer-ligand affinity. Topological tools, such as the conventional degree distribution, the rank-degree distribution (hierarchy), and the node assortativity are employed. In doing so, the macromolecules tertiary-structures are mapped into appropriate graphs. These graphs reproduce the main topological features of the macromolecules, by preserving the distances between amino acids (nucleotides). Calculations are applied to the thrombin binding aptamer (TBA), and the TBA-thrombin complex produced in the presence of Na or K. The topological analysis is able to detect several differences between complexes obtained in the presence of the two cations, as expected by previous investigations. These results support graph analysis as a novel computational tool for testing affinity. Otherwise, starting from the graphs, an electrical network can be obtained by using the specific electrical properties of amino acids and nucleobases. Therefore, a further analysis concerns with the electrical response, revealing that the resistance is sensitively affected by the presence of sodium or potassium, thus suggesting resistance as a useful physical parameter for testing binding affinity.