implementation of directional graphs.