Analyze the role of functions in modeling relationships in computer science, such as the correspondence between data structures and algorithms. How does understanding function properties aid in algorithms' optimization and complexity analysis?