Graphs and mathematical morphology