Maximum Cost Spanning Tree Algorithm