How to identify the minimum-weight edge using pattern matching?

Viewed 18

Suppose a weighted undirected graph (where each vertex has a string name) is represented by a list of edges, with each edge being a triple of the type String * String * int. Write an OCaml function to identify the minimum-weight edge in this graph. Use pattern matching to solve this problem.

How do I solve this problem? Does anyone know?

0 Answers
Related