Upload
others
View
12
Download
0
Embed Size (px)
Citation preview
Jacobians,Graphs,
Combinatorics
Uwe Naumann
F → G
G → F ′
Paths
Vertices
Edges
Faces
Algorithms
Complexity
Consequences
Conclusion
Jacobians, Graphs, Combinatorics
Uwe Naumann
LuFG Software and Tools for Computational EngineeringDept. of Computer Science, RWTH Aachen University, Germany
Jacobians,Graphs,
Combinatorics
Uwe Naumann
F → G
G → F ′
Paths
Vertices
Edges
Faces
Algorithms
Complexity
Consequences
Conclusion
Content
1 F → G
2 G → F ′
PathsVerticesEdgesFaces
3 Algorithms
4 Complexity
5 Consequences
6 Conclusion
Jacobians,Graphs,
Combinatorics
Uwe Naumann
F → G
G → F ′
Paths
Vertices
Edges
Faces
Algorithms
Complexity
Consequences
Conclusion
(Linearized) Computational Graph
t = x0 · sin(x0 · x1)x0 = cos(t)x1 = t/x1
v−1 = x0v0 = x1v1 = v−1 · v0 c1,−1 = v0; c1,0 = . . .v2 = sin(v1) c2,1 = cos(v1)v3 = v−1 · v2 c3,−1 = v2; c3,2 = . . .v4 = cos(v3) c4,3 = − sin(v3)v5 = v3/v0 c5,3 = 1/v0; c5,0 = . . .x0 = v4x1 = v5
���������
���������
���������
���������
���������
���������
������������
������������
��������
��
��
��
��
�������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������
����
����
����
����
����
����
����
����
����
����
����
���������������������������������������������������������������������������������������������������
������������������������������������������������
���������������������������������������������������������������
���������������
���������
���������
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������
PSfrag replacements
−1 0
1
2
3
4 5
c1,−1
c1,0
c2,1
c3,2
c3,−1
c4,3c5,3
c5,0
G = (V ,E )
Jacobians,Graphs,
Combinatorics
Uwe Naumann
F → G
G → F ′
Paths
Vertices
Edges
Faces
Algorithms
Complexity
Consequences
Conclusion
Elimination of Paths
∂vk∂vl
≡ f ′k,l =∑
[l→k]
∏
(i ,j)∈[l→k]
cj ,i
For example,
f ′(4,−1) = c3,−1·c4,3+c1,−1·c2,1·c3,2·c4,3
= (c3,−1 + c1,−1 · c2,1 · c3,2) · c4,3
Objective ...
���������
���������
���������
���������
���������
���������
������������
������������
��������
��
��
��
��
�������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������
����
����
����
����
����
����
����
����
����
����
����
���������������������������������������������������������������������������������������������������
������������������������������������������������
���������������������������������������������������������������
���������������
���������
���������
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������
PSfrag replacements
−1 0
1
2
3
4 5
c1,−1
c1,0
c2,1
c3,2
c3,−1
c4,3c5,3
c5,0
I W. Baur and V. Strassen: The complexity of partial derivatives. 1983
Jacobians,Graphs,
Combinatorics
Uwe Naumann
F → G
G → F ′
Paths
Vertices
Edges
Faces
Algorithms
Complexity
Consequences
Conclusion
Bipartite Computational Graph
���������
���������
���������
���������
���������
���������
���������
���������
������
�
�
����������
������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������
����
����
����
����
����
����
����
����
����
����
����
���������������������������������������������������������������������������������������������������
���������������������������������������������������������������
���������
���������
���������
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������
PSfrag replacements
−1 0
1
2
3
4 5
c1,−1
c1,0
c2,1
c3,2
c3,−1
c4,3c5,3
c5,0=⇒
���������������
���������������
���������������
���������
���������������
� � �
!�!�!!�!�!!�!�!
"�"�""�"�""�"�"
###############################################
$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$
%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
'''''''''''''''''''''''''''''''''''''''''''''''
(�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�((�(�(�(�(�(�(�(�(
)�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�))�)�)�)�)�)�)�)�)
PSfrag replacements
−1 0
4 5
f ′4,−1
f ′5,−1
f ′4,0
f ′5,0
G G ′
Jacobians,Graphs,
Combinatorics
Uwe Naumann
F → G
G → F ′
Paths
Vertices
Edges
Faces
Algorithms
Complexity
Consequences
Conclusion
Elimination of VerticesPSfrag replacements
−1 0
1
2 3
a b
c
de
PSfrag replacements
−1 0
1
2 3
c + ad be
bd
ae
Cost(j) = |Pj | · |Sj | (Cost(1) = |P1| · |S1| = 2 · 2 = 4)
I A. Griewank and S. Reese: On the calculation of Jacobian Matrices by
the Markovitz rule. Proceedings of AD1991, SIAM (1991)
I K. Herley: On minimal fill-in Jacobian accumulation. ANL, 1992
Jacobians,Graphs,
Combinatorics
Uwe Naumann
F → G
G → F ′
Paths
Vertices
Edges
Faces
Algorithms
Complexity
Consequences
Conclusion
Search Space (Mv)
For example, |V | = 3 :
→ |V |! elimination sequences
→ shortest path problem incost-enhanced metagraphMv
→ size of Mv is exponentialin size of G
PSfrag replacements
G
G ′
1 2 3
1, 2 1, 3 2, 3
Jacobians,Graphs,
Combinatorics
Uwe Naumann
F → G
G → F ′
Paths
Vertices
Edges
Faces
Algorithms
Complexity
Consequences
Conclusion
Lion Graph
������������������
������������������
������������
������������
������������������
������
��
��
��
������������������������������
��
��
�����������
������������������������
������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������
���������������������������������������������
��������������������������������������������� ������������������
����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
���������������������������������������������
���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �
PSfrag replacements
−1
0
1 2
3
4
5
6f ′3,−1 = c1,−1 · c2,1 · c3,2
. . .
f ′6,−1 = c1,−1 · c2,1 · c6,2 + c1,−1 · c6,1 = c1,−1 · (c2,1 · c6,2 + c6,1)
f ′6,0 = c1,0 · c2,1 · c6,2 + c1,0 · c6,1 = c1,0 · (c2,1 · c6,2 + c6,1)
Jacobians,Graphs,
Combinatorics
Uwe Naumann
F → G
G → F ′
Paths
Vertices
Edges
Faces
Algorithms
Complexity
Consequences
Conclusion
(Front-)Elimination of EdgesPSfrag replacements
−1 0
1
2 3
a b
c
de
���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
����������������������������
����������������������������
PSfrag replacements
−1 0
1
2 3
c + ad
aeb
d
e
Cost((i , j)) = |Sj | (Cost((−1, 1)) = |S1| = 2)
I U. Naumann: Elimination Techniques for Cheap Jacobians. Proceedings
of AD2000, Springer (2000)
Jacobians,Graphs,
Combinatorics
Uwe Naumann
F → G
G → F ′
Paths
Vertices
Edges
Faces
Algorithms
Complexity
Consequences
Conclusion
(Back-)Elimination of Edges
PSfrag replacements
−1 0
1
2 3
a b
c
de
PSfrag replacements
−1 0
1
2 3
b
d
c
a
ae
be
Cost((i , j)) = |Pi | (Cost((1, 3)) = |P1| = 2)
Jacobians,Graphs,
Combinatorics
Uwe Naumann
F → G
G → F ′
Paths
Vertices
Edges
Faces
Algorithms
Complexity
Consequences
Conclusion
Search Space (Me)
����
����
����
����
��
��
��
����
����
����
����
����
����
����
����
����
!!
""##
$$%%
&&''
(())
**++
,,--
..//
0011
2233
4455
6677
8899
::;;
??
@@AA
BBCC
DDEE
FFGG
HHII
JJKK
LLMM
NONNONNONPOPPOPPOPQOQQOQQOQRORRORROR
SOSSOSSOSTOTTOTTOT
UOUUOUUOUVOVVOVVOVWOWWOWWOWXOXXOXXOX
YOYYOYYOYZOZZOZZOZ
[O[[O[[O[\O\\O\\O\]O]]O]]O]^O^^O^^O^
_O__O__O_`O``O``O`aOaaOaaOabObbObbOb
cOcOccOcOccOcOcdOdOddOdOddOdOd
eOeeOeeOefOffOffOfgOggOggOghOhhOhhOh
iOiiOiiOijOjjOjjOj
kOkkOkkOklOllOllOlmOmmOmmOmnOnnOnnOn
oOooOooOopOppOppOp
qOqqOqqOqrOrrOrrOr
sOssOssOstOttOttOt
uOuuOuuOuvOvvOvvOv
22
2
2
2 2
2
11 1
1
2
1 1
Jacobians,Graphs,
Combinatorics
Uwe Naumann
F → G
G → F ′
Paths
Vertices
Edges
Faces
Algorithms
Complexity
Consequences
Conclusion
Rerouting
PSfrag replacements
→ ∞
i
j
j ′PSfrag replacements
→ ∞
i
j
j ′
I A. Griewank and O. Vogel: Analysis and exploitation of Jacobian
scarcity. Proceedings of HPSC (2003)
Jacobians,Graphs,
Combinatorics
Uwe Naumann
F → G
G → F ′
Paths
Vertices
Edges
Faces
Algorithms
Complexity
Consequences
Conclusion
Bat Graph
���������
���������
���������
���������
���������
���������
���������
���������
������
�
�
�
���������������
���������������
�
�
�
���������
������������
������������
������������
������������
���������������������������������
������������������������������
���������������������������������
������������������������������
�������������������������������������������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������������������������������������������
�����������������������������������������������������������������������������
�����������������������������������������������������������������������������
�����������������������������������������������������������������������������
�����������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �
!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!!�!�!�!�!�!�!�!
"�"�"�"�"�"�"�""�"�"�"�"�"�"�""�"�"�"�"�"�"�""�"�"�"�"�"�"�""�"�"�"�"�"�"�""�"�"�"�"�"�"�""�"�"�"�"�"�"�""�"�"�"�"�"�"�""�"�"�"�"�"�"�""�"�"�"�"�"�"�""�"�"�"�"�"�"�""�"�"�"�"�"�"�""�"�"�"�"�"�"�""�"�"�"�"�"�"�""�"�"�"�"�"�"�""�"�"�"�"�"�"�""�"�"�"�"�"�"�""�"�"�"�"�"�"�""�"�"�"�"�"�"�""�"�"�"�"�"�"�""�"�"�"�"�"�"�""�"�"�"�"�"�"�""�"�"�"�"�"�"�""�"�"�"�"�"�"�""�"�"�"�"�"�"�""�"�"�"�"�"�"�""�"�"�"�"�"�"�""�"�"�"�"�"�"�""�"�"�"�"�"�"�""�"�"�"�"�"�"�""�"�"�"�"�"�"�""�"�"�"�"�"�"�""�"�"�"�"�"�"�"
#�#�#�#�#�#�#�#�#�#�#�#�#�##�#�#�#�#�#�#�#�#�#�#�#�#�##�#�#�#�#�#�#�#�#�#�#�#�#�##�#�#�#�#�#�#�#�#�#�#�#�#�##�#�#�#�#�#�#�#�#�#�#�#�#�##�#�#�#�#�#�#�#�#�#�#�#�#�##�#�#�#�#�#�#�#�#�#�#�#�#�##�#�#�#�#�#�#�#�#�#�#�#�#�##�#�#�#�#�#�#�#�#�#�#�#�#�##�#�#�#�#�#�#�#�#�#�#�#�#�##�#�#�#�#�#�#�#�#�#�#�#�#�##�#�#�#�#�#�#�#�#�#�#�#�#�##�#�#�#�#�#�#�#�#�#�#�#�#�##�#�#�#�#�#�#�#�#�#�#�#�#�##�#�#�#�#�#�#�#�#�#�#�#�#�##�#�#�#�#�#�#�#�#�#�#�#�#�##�#�#�#�#�#�#�#�#�#�#�#�#�##�#�#�#�#�#�#�#�#�#�#�#�#�##�#�#�#�#�#�#�#�#�#�#�#�#�##�#�#�#�#�#�#�#�#�#�#�#�#�##�#�#�#�#�#�#�#�#�#�#�#�#�#
$�$�$�$�$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$�$�$�$�$�$�$
%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%
&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&
'�'�''�'�''�'�''�'�'
(�((�((�((�(
)�))�))�))�))�))�))�))�))�))�))�)
*�**�**�**�**�**�**�**�**�**�*
+�++�++�++�++�++�++�++�++�++�++�+
,�,,�,,�,,�,,�,,�,,�,,�,,�,,�,
PSfrag replacements
−3−2−10
1 2
3
4
56
7
Jacobians,Graphs,
Combinatorics
Uwe Naumann
F → G
G → F ′
Paths
Vertices
Edges
Faces
Algorithms
Complexity
Consequences
Conclusion
Dual Computational GraphPSfrag replacements
a b
c
de
PSfrag replacements
a b
c
d e
I U. Naumann: Optimal Accumulation of Jacobian matrices by elimination
methods on the dual computational graph. Math. Prog., Springer (2004)
Jacobians,Graphs,
Combinatorics
Uwe Naumann
F → G
G → F ′
Paths
Vertices
Edges
Faces
Algorithms
Complexity
Consequences
Conclusion
Elimination of Faces
PSfrag replacements
a b
c
d e
���������������
���������
PSfrag replacements
a b
c
d e
eb
Cost((i , j)) = 1
Jacobians,Graphs,
Combinatorics
Uwe Naumann
F → G
G → F ′
Paths
Vertices
Edges
Faces
Algorithms
Complexity
Consequences
Conclusion
Search Space (Mf )����
����
����
����
��
��
��
����
����
����
����
����
����
����
����
����
!!
""##
$%$$%$$%$$%$$%$$%$$%$
&%&&%&&%&&%&&%&&%&&%&'%''%''%''%''%''%''%'
(%((%((%((%((%((%((%(
)%)%))%)%))%)%))%)%)*%*%**%*%**%*%**%*%*+%+%++%+%++%+%++%+%+,%,%,,%,%,,%,%,,%,%, -%-
-%--%--%--%--%--%-
.%..%..%..%..%..%..%.
/%//%//%//%//%//%//%/
0%00%00%00%00%00%00%0
1122
3344
5566
7788
99::
;;<<
==>>
??@@
AABB
CCDD
EEFF
GGHH
IIJJ
KKLL
MMNN
OOPP
QQRR
SSTT
UUVV
WWXX
YYZZ
[[\\
]]^^
__``
aabb
ccdd
eeff
gghh
iijj
kkll
mmnn
oopp
qqrr
sstt
uuvv
wwxx
yyzz
{{||
}}~~
¡¡¢¢
££¤¤
¥¥¦¦
§§¨¨
©©ªª
««¬¬
®®
¯¯°°
±±²²
³³´´
µµ¶¶
··¸¸
¹¹ºº
»»¼¼
½½¾¾
¿¿ÀÀ
ÁÁÂÂ
ÃÃÄÄ
ÅÅÆÆ
ÇÇÈÈ
ÉÉÊÊ
ËËÌÌ
ÍÍÎÎ
ÏÏÐÐ
ÑÑÒÒ
ÓÓÔÔ
ÕÕÖÖ
××ØØ
ÙÙÚÚ
ÛÛÜÜ
ÝÝÞÞ
ßßàà
ááââ
ããää
ååææ
ççèè
ééêê
ëëìì
ííîî ïïð
ð
ññòò
óóôô
õõöö ÷÷ø
ø
ùùúú
ûûüü
ýýþþ
ÿÿ��
����
����
����
����
����
���
��� ����
����
�����
��� ����
�����
��� ��
!!"" ##$
$
%%&&
''(()
)**
++,,
-.--.--.--.--.--.--.-
/.//.//.//.//.//.//./
0.0.00.0.00.0.00.0.01.1.11.1.11.1.11.1.1
2.22.22.22.22.22.22.22.22.2
3.33.33.33.33.33.33.33.33.3
4.4.44.4.44.4.44.4.45.5.55.5.55.5.55.5.566667777
8.88.88.88.88.88.88.8
9.99.99.99.99.99.99.9
:.::.::.::.::.::.::.:
;.;;.;;.;;.;;.;;.;;.;
>.>>.>>.>>.>
?.??.??.??.??.??.??.??.??.?
@.@@.@@.@@[email protected]
B.BB.BB.BB.BB.BB.BB.B
C.CC.CC.CC.CC.CC.CC.CD.D.DD.D.D
D.D.DD.D.DE.E.EE.E.EE.E.EE.E.EF.F.FF.F.FF.F.FF.F.FG.G.GG.G.GG.G.GG.G.G H.H
H.HH.HH.HH.HH.HH.H
I.II.II.II.II.II.II.I
J.JJ.JJ.JJ.JJ.JJ.JJ.JJ.JJ.J
K.KK.KK.KK.KK.KK.KK.KK.KK.K
L.L.LL.L.LL.L.LL.L.LM.M.MM.M.MM.M.MM.M.MN.NN.NN.NN.NO.OO.OO.OO.O
P.PP.PP.PP.PQ.QQ.QQ.QQ.QR.R.RR.R.RR.R.RR.R.RS.S.SS.S.SS.S.SS.S.ST.TT.TT.TT.TT.TT.TT.TT.TT.T
U.UU.UU.UU.UU.UU.UU.UU.UU.U
V.V.VV.V.VV.V.VV.V.VW.W.WW.W.WW.W.WW.W.WX.X.XX.X.XX.X.XX.X.XY.Y.YY.Y.YY.Y.YY.Y.Y
Z.ZZ.ZZ.ZZ.ZZ.ZZ.ZZ.Z
[.[[.[[.[[.[[.[[.[[.[\.\\.\\.\\.\\.\\.\\.\
].]].]].]].]].]].]].]
^.^.^^.^.^^.^.^^.^.^_._.__._.__._.__._._`.`.``.`.``.`.``.`.`a.a.aa.a.aa.a.aa.a.a
b.b.bb.b.bb.b.bb.b.bc.c.cc.c.cc.c.cc.c.c d.d
d.dd.dd.dd.dd.dd.d
e.ee.ee.ee.ee.ee.ee.e
f.ff.ff.ff.ff.ff.ff.f
g.gg.gg.gg.gg.gg.gg.g
h.hh.hh.hh.hi.ii.ii.ii.i
j.jj.jj.jj.jj.jj.jj.jj.jj.j
k.kk.kk.kk.kk.kk.kk.kk.kk.kl.l.ll.l.ll.l.ll.l.lm.m.mm.m.mm.m.mm.m.m n.n
n.nn.nn.nn.nn.nn.n
o.oo.oo.oo.oo.oo.oo.o
p.pp.pp.pp.pp.pp.pp.p
q.qq.qq.qq.qq.qq.qq.q
r.rr.rr.rr.rs.ss.ss.ss.s
t.tt.tt.tt.tt.tt.tt.tt.tt.t
u.uu.uu.uu.uu.uu.uu.uu.uu.u
v.v.vv.v.vv.v.vv.v.vw.w.ww.w.ww.w.ww.w.w
x.xx.xx.xx.xy.yy.yy.yy.y
z.zz.zz.zz.zz.zz.zz.zz.zz.z
{.{{.{{.{{.{{.{{.{{.{{.{{.{|.||.||.||.|}.}}.}}.}}.}
~.~~.~~.~~.~~.~~.~~.~~.~~.~
.........
.......
.......
.......
.......
.......
.......
.......
...........
............
.........
.........
........
..............
.......
..............
.......
.......
.......
.......
.......
.........
.................
................
........
.........
......... . . . . ¡.¡¡.¡¡.¡¡.¡
¢.¢¢.¢¢.¢¢.¢¢.¢¢.¢¢.¢¢.¢¢.¢
£.££.££.££.££.££.££.££.££.£¤.¤¤.¤
¤.¤¤.¤¤.¤¤.¤¤.¤
¥.¥¥.¥¥.¥¥.¥¥.¥¥.¥¥.¥
¦.¦¦.¦¦.¦¦.¦¦.¦¦.¦¦.¦
§.§§.§§.§§.§§.§§.§§.§
¨.¨¨.¨¨.¨¨.¨¨.¨¨.¨¨.¨
©.©©.©©.©©.©©.©©.©©.©
ª.ªª.ªª.ªª.ªª.ªª.ªª.ª
«.««.««.««.««.««.««.«
¬.¬¬.¬¬.¬¬.¬....
®.®®.®®.®®.®®.®®.®®.®®.®®.®
¯.¯¯.¯¯.¯¯.¯¯.¯¯.¯¯.¯¯.¯¯.¯°.°°.°°.°°.°±.±±.±±.±±.±
².²².²².²².²².²².²².²².²².²
³.³³.³³.³³.³³.³³.³³.³³.³³.³
´.´´.´´.´´.´´.´´.´´.´
µ.µµ.µµ.µµ.µµ.µµ.µµ.µ
¶.¶¶.¶¶.¶¶.¶¶.¶¶.¶¶.¶
·.··.··.··.··.··.··.·
¸.¸¸.¸¸.¸¸.¸¸.¸¸.¸¸.¸
¹.¹¹.¹¹.¹¹.¹¹.¹¹.¹¹.¹
º.ºº.ºº.ºº.ºº.ºº.ºº.º
».»».»».»».»».»».»».»
¼.¼¼.¼¼.¼¼.¼½.½½.½½.½½.½
¾.¾¾.¾¾.¾¾.¾¾.¾¾.¾¾.¾¾.¾¾.¾
¿.¿¿.¿¿.¿¿.¿¿.¿¿.¿¿.¿¿.¿¿.¿À.ÀÀ.ÀÀ.ÀÀ.ÀÁ.ÁÁ.ÁÁ.ÁÁ.Á
Â.ÂÂ.ÂÂ.ÂÂ.ÂÂ.ÂÂ.ÂÂ.ÂÂ.ÂÂ.Â
Ã.ÃÃ.ÃÃ.ÃÃ.ÃÃ.ÃÃ.ÃÃ.ÃÃ.ÃÃ.Ã
Jacobians,Graphs,
Combinatorics
Uwe Naumann
F → G
G → F ′
Paths
Vertices
Edges
Faces
Algorithms
Complexity
Consequences
Conclusion
Compile-time Elimination
t = x0 + (x0 · x1) · 3.14x0 = cos(t)x1 = t/x1
���������
���������
���������
���������
������������
������������
��������������������
������������
�������������������������������������������������������
�����
�����
�����
�����
�����
�����
�����
�����
�����
�����
�����
���������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������
��������������������
������������
������������
������������
���������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
������������������������������������������������
������������������������������������������������
PSfrag replacements
−1 0
1
2
3
4 5
c1,−1
c1,0
3.14
c3,2
c3,−1
c4,3
c4,3
c5,3
c5,3
c5,0
I U. Naumann and J. Utke: Optimality-preserving elimination of linearities
in Jacobian accumulation. Electronic Transactions on Numerical Analysis,
KSU (2005).
Jacobians,Graphs,
Combinatorics
Uwe Naumann
F → G
G → F ′
Paths
Vertices
Edges
Faces
Algorithms
Complexity
Consequences
Conclusion
Heuristics
���������
���������
���������
���������
���������
���������
���������
���������
���
�
�
�
���������
���������
�
�
�
���������
���������
���������
���������
���������
���������
���������
����������������������������������������������������������������������
����������������������������������������������������������������������
����������������������������������������������������������������������
����������������������������������������������������������������������
�����������������������������������������������������������������������������������������������������������������������������������������������������������������
�����������������������������������������������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
�����������������������������������������������������������������������������������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������������������������������������������������
� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �
!�!�!�!!�!�!�!!�!�!�!!�!�!�!!�!�!�!!�!�!�!!�!�!�!!�!�!�!!�!�!�!!�!�!�!
"�"�"�""�"�"�""�"�"�""�"�"�""�"�"�""�"�"�""�"�"�""�"�"�""�"�"�""�"�"�"
#�#�#�#�#�#�#�##�#�#�#�#�#�#�##�#�#�#�#�#�#�##�#�#�#�#�#�#�##�#�#�#�#�#�#�##�#�#�#�#�#�#�##�#�#�#�#�#�#�##�#�#�#�#�#�#�##�#�#�#�#�#�#�##�#�#�#�#�#�#�#
$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$$�$�$�$�$�$�$�$
%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%
&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&
'�'�'�'�''�'�'�'�''�'�'�'�''�'�'�'�''�'�'�'�''�'�'�'�''�'�'�'�''�'�'�'�''�'�'�'�''�'�'�'�'
(�(�(�(�((�(�(�(�((�(�(�(�((�(�(�(�((�(�(�(�((�(�(�(�((�(�(�(�((�(�(�(�((�(�(�(�((�(�(�(�(
)�)�)�)�)�)�))�)�)�)�)�)�))�)�)�)�)�)�))�)�)�)�)�)�))�)�)�)�)�)�))�)�)�)�)�)�))�)�)�)�)�)�))�)�)�)�)�)�))�)�)�)�)�)�))�)�)�)�)�)�)
*�*�*�*�*�*�**�*�*�*�*�*�**�*�*�*�*�*�**�*�*�*�*�*�**�*�*�*�*�*�**�*�*�*�*�*�**�*�*�*�*�*�**�*�*�*�*�*�**�*�*�*�*�*�**�*�*�*�*�*�*
+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�++�+�+�+�+�+�+�+�+�+�+�+�+�+�+�++�+�+�+�+�+�+�+�+�+�+�+�+�+�+�++�+�+�+�+�+�+�+�+�+�+�+�+�+�+�++�+�+�+�+�+�+�+�+�+�+�+�+�+�+�++�+�+�+�+�+�+�+�+�+�+�+�+�+�+�++�+�+�+�+�+�+�+�+�+�+�+�+�+�+�++�+�+�+�+�+�+�+�+�+�+�+�+�+�+�++�+�+�+�+�+�+�+�+�+�+�+�+�+�+�++�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+
,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,
I U. Naumann: An Enhanced Markovitz Rule for Accumulating Jacobians
Efficiently. Proceedings of 15th Conference on Scientific Computing
(ALGORITHMY 2000).
Jacobians,Graphs,
Combinatorics
Uwe Naumann
F → G
G → F ′
Paths
Vertices
Edges
Faces
Algorithms
Complexity
Consequences
Conclusion
Dynamic Programming
F ′(x) = Qm
l+m∏
j=1
∏
i≺j
Cji
PTn ∈ IRm×n
where
Pn ≡[
In, 0]
∈ IRn×q and Qm ≡[
0, Im]
∈ IRm×q
I A. Griewank and U. Naumann: Accumulating Jacobians as Chained
Sparse Matrix Products. Math. Prog., Springer (2003).
Jacobians,Graphs,
Combinatorics
Uwe Naumann
F → G
G → F ′
Paths
Vertices
Edges
Faces
Algorithms
Complexity
Consequences
Conclusion
Simulated Annealing
• start sequence, start temperature
• (logarithmic) cooling schedule
• acceptance of worse sequence with Metropolis probability
• run for as long as you like ...
0
200
400
600
800
1000
1200
0 10 20 30 40 50 60 70
-40
-20
0
20
40
0 1000 2000 3000 4000 5000
I U. Naumann: Cheaper Jacobians by Simulated Annealing. SIAM J.
Opt., SIAM (2002).
Jacobians,Graphs,
Combinatorics
Uwe Naumann
F → G
G → F ′
Paths
Vertices
Edges
Faces
Algorithms
Complexity
Consequences
Conclusion
Single-Expression-Use Graphs
���������
���������
���������
���������
���������
���������
���������
���������
���
�
�
�
���������
���������
�
�
�
���������
����������������������������������������������������������������������
����������������������������������������������������������������������
����������������������������������������������������������������������
����������������������������������������������������������������������
����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
����������������������������������������������������������������������
����������������������������������������������������������������������
����������������������������������������������������������������������
����������������������������������������������������������������������
����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������