Special network algorithms with gains