hadn't we previously parameterized the function which extracts value for each edge? Consider writing a placeholder function which pulls this value, and apply here, instead of referencing the target metric directly.