#330: added algorithm implementation and iterator for graph. refactored data mode