// Algorithms to design electrical grids // !!! DO NOT MODIFY THIS FILE !!! #ifndef PLANNER_H #define PLANNER_H #include "place.h" //////////////////////////////////////////////////////////////////////// // Your task /** * Designs a minimal cost electrical grid that will deliver electricity * from a power plant to all the given cities. Power lines must be built * between cities or between a city and a power plant. Cost is directly * proportional to the total length of power lines used. * Stores the power lines that need to be built in the given powerLines * array, and returns the number of power lines stored. Assumes that the * powerLines array is large enough to store all the power lines. */ int planGrid1(struct place cities[], int numCities, struct place powerPlant, struct powerLine powerLines[]); //////////////////////////////////////////////////////////////////////// // Optional task /** * Designs a minimal cost electrical grid that will deliver electricity * to all the given cities. Power lines must be built between cities or * between a city and a power plant. Cost is directly proportional to * the total length of power lines used. Assume that each power plant * generates enough electricity to supply all cities, so not all power * plants need to be used. * Stores the power lines that need to be built in the given powerLines * array, and returns the number of power lines stored. Assumes that the * powerLines array is large enough to store all the power lines. */ int planGrid2(struct place cities[], int numCities, struct place powerPlants[], int numPowerPlants, struct powerLine powerLines[]); #endif