Learning and associative memory are understood as emergent phenomena resulting from interactions between a complex network of neurons. It is well known that the structure of such a neural network heavily influences its function. Biological networks (e.g. neuronal network of the worm Caenorhabditis elegans) have been shown to exhibit small-world characteristics. To investigate the structure-function relationship in small-world networks, we simulate the Hopfield model of associative memory on a regular and Watts-Strogatz network. We obtain estimates of memory capacity on a regular and a WS network through numerical simulations. Further, we study how changing the probability of rewiring and local connectivity in a WS network affects the performance of associative memory. We find that the performance on small-world networks is as robust as that on random networks despite using only a fraction of connections, making the former biologically favorable. Our simulations are in agreement with experimental evidence found in the existing literature on small-world characteristics in biological networks and give deeper insights into this phenomenon. © 2021 Author(s).