Extremal graphs under Wienner-type invariants