File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -395,12 +395,16 @@ def is_multigraph(self):
395395 def element_order (self ) -> tuple :
396396 """
397397 Return a value which is used in ordering elements
398- of an expression. The tuple is ultimately compared lexicographically.
398+ of an expression and Sort[] . The tuple is ultimately compared lexicographically.
399399 """
400- # Return the precedence the expression `Image[]`,
401- # but with a `2` instead of `1` in the 5th position,
402- # and adding two extra fields: the length in the 3rd position,
403- # and a hash in the 6th place.
400+ # Return the precedence similar to the key for an `Image[]`
401+ # object, but with a `2` instead of `1` in the 5th position,
402+ #
403+ # Graphs with fewer vertices in a graph should appear before
404+ # nodes with more vertices. This property is captured by the
405+ # 3rd position, of the order tuple. A hash of the object is put
406+ # last for two graphs are structurally the same but different, so that
407+ # the same graph object will appear consecutively in a Sort[].
404408 return (
405409 GRAPH_EXPRESSION_SORT_KEY ,
406410 SymbolGraph ,
You can’t perform that action at this time.
0 commit comments