Drawing a Decision Diagram with Tikz and layout manager The Next CEO of Stack Overflow
Whats the best way to handle refactoring a big file?
Why do professional authors make "consistency" mistakes? And how to avoid them?
How to start emacs in "nothing" mode (`fundamental-mode`)
I believe this to be a fraud - hired, then asked to cash check and send cash as Bitcoin
Implement the Thanos sorting algorithm
How to make a variable always equal to the result of some calculations?
What does "Its cash flow is deeply negative" mean?
How to safely derail a train during transit?
Only print output after finding pattern
What do "high sea" and "carry" mean in this sentence?
How to Reset Passwords on Multiple Websites Easily?
How can I open an app using Terminal?
How can I quit an app using Terminal?
Return the Closest Prime Number
Does it take more energy to get to Venus or to Mars?
Is it my responsibility to learn a new technology in my own time my employer wants to implement?
How to understand which control sequence in undefined in "Undefined control sequence." message?
MAZDA 3 2006 (UK) - poor acceleration then takes off at 3250 revs
What is the point of a new vote on May's deal when the indicative votes suggest she will not win?
Text adventure game code
How long to clear the 'suck zone' of a turbofan after start is initiated?
How to count occurrences of text in a file?
Opposite of a diet
Natural language into sentence logic
Drawing a Decision Diagram with Tikz and layout manager
The Next CEO of Stack Overflow
I'm trying to draw decision diagrams (DD) in an automated fashion. A DD is a DAG, where all nodes are partitioned in layers. Edges typically go from a node in layer l to another node in layer l+1. Each edge has a label, and there can be multiple edges between the same pair of nodes. Two example DDs can be found below. These are drawn by manually specifying all coordinates of all nodes. Since I need to draw a large number of those, I'd like to automate this. Therefore I'm using the layout manager of tikz. Here's an example:
RequirePackageluatex85
documentclassstandalone
usepackagetikz
usetikzlibrarygraphs,graphdrawing,quotes
usegdlibrarylayered
begindocument
begintikzpicture[rounded corners]
graph [layered layout,
edge quotes=fill=white,inner sep=1pt,
nodes=circle,draw
]
r ->["3"] 1, 0, 2,
1 -> 4,6,
0 -> 4,5,6,
2 -> 6,
4 -> t,
5 -> t,
6 -> t
;
endtikzpicture
enddocument
The above code works pretty well. Next I'm looking for a way to do the following:
- how to specify the vertical space between layers?
- how to draw multiple edges between the same pair of nodes? In the right most figure, you see nodes with 2 edges, e.g. v2,v4. There can be more than 2 edges between the same pair of nodes. The edges must be drawn non-overlapping. E.g. what if I had 10 edges with different labels between the same pair of nodes?
- Next to the left most graph, there are labels pi_1, pi_2. These labels are vertically aligned and are next to the edges. How do I add those?
Note: I'm not looking to exactly replicate the graphs in the figure. Something else that is aesthetically pleasing is good enough.
tikz-pgf graphs layout
add a comment |
I'm trying to draw decision diagrams (DD) in an automated fashion. A DD is a DAG, where all nodes are partitioned in layers. Edges typically go from a node in layer l to another node in layer l+1. Each edge has a label, and there can be multiple edges between the same pair of nodes. Two example DDs can be found below. These are drawn by manually specifying all coordinates of all nodes. Since I need to draw a large number of those, I'd like to automate this. Therefore I'm using the layout manager of tikz. Here's an example:
RequirePackageluatex85
documentclassstandalone
usepackagetikz
usetikzlibrarygraphs,graphdrawing,quotes
usegdlibrarylayered
begindocument
begintikzpicture[rounded corners]
graph [layered layout,
edge quotes=fill=white,inner sep=1pt,
nodes=circle,draw
]
r ->["3"] 1, 0, 2,
1 -> 4,6,
0 -> 4,5,6,
2 -> 6,
4 -> t,
5 -> t,
6 -> t
;
endtikzpicture
enddocument
The above code works pretty well. Next I'm looking for a way to do the following:
- how to specify the vertical space between layers?
- how to draw multiple edges between the same pair of nodes? In the right most figure, you see nodes with 2 edges, e.g. v2,v4. There can be more than 2 edges between the same pair of nodes. The edges must be drawn non-overlapping. E.g. what if I had 10 edges with different labels between the same pair of nodes?
- Next to the left most graph, there are labels pi_1, pi_2. These labels are vertically aligned and are next to the edges. How do I add those?
Note: I'm not looking to exactly replicate the graphs in the figure. Something else that is aesthetically pleasing is good enough.
tikz-pgf graphs layout
add a comment |
I'm trying to draw decision diagrams (DD) in an automated fashion. A DD is a DAG, where all nodes are partitioned in layers. Edges typically go from a node in layer l to another node in layer l+1. Each edge has a label, and there can be multiple edges between the same pair of nodes. Two example DDs can be found below. These are drawn by manually specifying all coordinates of all nodes. Since I need to draw a large number of those, I'd like to automate this. Therefore I'm using the layout manager of tikz. Here's an example:
RequirePackageluatex85
documentclassstandalone
usepackagetikz
usetikzlibrarygraphs,graphdrawing,quotes
usegdlibrarylayered
begindocument
begintikzpicture[rounded corners]
graph [layered layout,
edge quotes=fill=white,inner sep=1pt,
nodes=circle,draw
]
r ->["3"] 1, 0, 2,
1 -> 4,6,
0 -> 4,5,6,
2 -> 6,
4 -> t,
5 -> t,
6 -> t
;
endtikzpicture
enddocument
The above code works pretty well. Next I'm looking for a way to do the following:
- how to specify the vertical space between layers?
- how to draw multiple edges between the same pair of nodes? In the right most figure, you see nodes with 2 edges, e.g. v2,v4. There can be more than 2 edges between the same pair of nodes. The edges must be drawn non-overlapping. E.g. what if I had 10 edges with different labels between the same pair of nodes?
- Next to the left most graph, there are labels pi_1, pi_2. These labels are vertically aligned and are next to the edges. How do I add those?
Note: I'm not looking to exactly replicate the graphs in the figure. Something else that is aesthetically pleasing is good enough.
tikz-pgf graphs layout
I'm trying to draw decision diagrams (DD) in an automated fashion. A DD is a DAG, where all nodes are partitioned in layers. Edges typically go from a node in layer l to another node in layer l+1. Each edge has a label, and there can be multiple edges between the same pair of nodes. Two example DDs can be found below. These are drawn by manually specifying all coordinates of all nodes. Since I need to draw a large number of those, I'd like to automate this. Therefore I'm using the layout manager of tikz. Here's an example:
RequirePackageluatex85
documentclassstandalone
usepackagetikz
usetikzlibrarygraphs,graphdrawing,quotes
usegdlibrarylayered
begindocument
begintikzpicture[rounded corners]
graph [layered layout,
edge quotes=fill=white,inner sep=1pt,
nodes=circle,draw
]
r ->["3"] 1, 0, 2,
1 -> 4,6,
0 -> 4,5,6,
2 -> 6,
4 -> t,
5 -> t,
6 -> t
;
endtikzpicture
enddocument
The above code works pretty well. Next I'm looking for a way to do the following:
- how to specify the vertical space between layers?
- how to draw multiple edges between the same pair of nodes? In the right most figure, you see nodes with 2 edges, e.g. v2,v4. There can be more than 2 edges between the same pair of nodes. The edges must be drawn non-overlapping. E.g. what if I had 10 edges with different labels between the same pair of nodes?
- Next to the left most graph, there are labels pi_1, pi_2. These labels are vertically aligned and are next to the edges. How do I add those?
Note: I'm not looking to exactly replicate the graphs in the figure. Something else that is aesthetically pleasing is good enough.
tikz-pgf graphs layout
tikz-pgf graphs layout
asked 2 mins ago
Joris KinableJoris Kinable
336111
336111
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f482062%2fdrawing-a-decision-diagram-with-tikz-and-layout-manager%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f482062%2fdrawing-a-decision-diagram-with-tikz-and-layout-manager%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown