Maximum Cost Spanning Tree Algorithm Code Example