Maximum Benefit Maintenance Plans On A Cactus Station Network

Company: Meltwater_14oct

Difficulty: hard

Problem Statement

Problem Description A desert water authority runs n pumping stations, numbered 1 to n , joined by m service links. The network is a connected cactus : it is connected, and no link lies on more than one simple cycle (two different simple cycles never have more than one station in common). Two links may join the same pair of stations; such parallel links are different links. Link i joins stations u and v and carries a signed benefit w , which can be positive, zero or negative. A maintenance plan is a set of links in which no two links touch the same station (a matching). The empty plan is allowed and has total benefit 0 . Two plans are different when their sets of links differ, so choosing one parallel link instead of the other gives a different plan. Among all plans, consider those whose total benefit is as large as possible. Report three numbers: 1. the largest total benefit of a plan, 2. how many different plans reach that largest benefit, modulo 1000000007 , 3. the fewest links used