Implemented discrete cost of roads (inefficiently)

Implemented function to calculate discrete cost of road layer.
Calculation for road layer discrete cost is very inefficient and takes
long to run.