Modularity of cycles and paths in graphs

Certain problems related to the length of cycles and paths modulo a given integer are studied. Linear-time algorithms are presented that determine whether all cycles in an undirected graph are of length <italic>P</italic> mod <italic>Q</italic> and whether all paths between two specified nodes are of length <italic>P</italic> mod <italic>Q</italic>, for fixed integers <italic>P</italic>.<italic>Q</italic>. These results are compared to those for directed graphs.