add an edge to this node (path to another node with the specified distance)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=ip), | intent(in) | :: | inode | |||
| integer(kind=ip), | intent(in) | :: | ichild | |||
| integer(kind=ip), | intent(in) | :: | idist |
subroutine add_edge(inode, ichild, idist) !! add an edge to this node (path to another node with the specified distance) integer(ip),intent(in) :: inode, ichild, idist if (.not. allocated(nodes(inode)%inext)) then allocate(nodes(inode)%inext(0)) allocate(nodes(inode)%idist(0)) end if nodes(inode)%inext = [nodes(inode)%inext, ichild] nodes(inode)%idist = [nodes(inode)%idist, idist] end subroutine add_edge