Optimization and management of materials in earthwork construction