Matroids and the greedy algorithm