schrodinger.application.matsci.graph module¶
Module containing methods applied on networkx graph
Copyright Schrodinger, LLC. All rights reserved.
-
schrodinger.application.matsci.graph.
get_sub_graphs
(graph)[source]¶ Generator of the disconnect graphs in the passed graph.
- Parameters
graph ('networkx.classes.graph.Graph') – The graph to find subgraphs in
- Return type
‘networkx.classes.graph.Graph’
- Returns
subgraph of the graph
-
schrodinger.application.matsci.graph.
get_fused_cycles
(graph)[source]¶ Return cycles (fused and non-fused) in the graph
- Parameters
graph ('networkx.classes.graph.Graph') – The graph to find cycles in
- Return type
list(set)
- Returns
list of sets of nodes that make each cycle
-
schrodinger.application.matsci.graph.
find_backbone
(graph)[source]¶ Find the shortest path between atoms that are furthest apart
- Parameters
graph ('networkx.classes.graph.Graph') – The graph to find longest path in
- Return type
list
- Returns
list of nodes in the longest path in the graph. Between the two end node, the node with lower index is considered as the first element of the list and the other as the last. In case of degeneracy due to cycles nodes in the path, the shortest path containing lowest indexes is selected.
-
schrodinger.application.matsci.graph.
find_segments
(graph)[source]¶ Find the segments in the input graph. Segments are path containing nodes where no node appears in a segment twice. Longest segments are always created first and then recursively smaller ones.
- Parameters
graph ('networkx.classes.graph.Graph') – The graph to find segments in
- Return type
list(list)
- Returns
list of list of nodes. Each sublist is a list of ordered nodes, starting from lower index of the two end nodes, forming the longest path graph not containing the nodes already considered.