>> Lev Nachmansen: So let's start with the session. And Till is going to give a talk about TikZ and graph drawing. My PhD students were very eager to hear about that paper. So I'm now eager to hear about it. >> Till Tantau: Yes. Thank you. And let's see if this works. Okay. Yes. So thanks everyone. And hello, everyone. Graph drawing in TikZ. That's something I want to talk about. Graph drawing in TikZ tries to address a problem that most of you, or perhaps every one of you has had, namely when you prepare a paper that is on graph drawing because then it's going to contain a drawing of a graph. And it turns out that's not so easy to get right. And just to show you an example, this is something I took from last year's conference proceedings, more or less randomly, I mean, all of papers contain drawing of graphs. And I think these are pretty nice drawings. Only with a very close look at it do you notice some things. For instance in this drawing we have some font of the main text. This is typical text document, so this is computer model whereas in the drawing itself you have a source of E font. You'll also notice that the math stuff isn't that great because the -- I mean this H prime doesn't look that great. Also, the size of the font kind of differs from the main text. It also turns out that the arrow tips are different. And this is all inside one picture. So inside one paper. So by the same authors. Now, this is very typical. This is something that happens a lot of times. And there is a reason for that. And the reason for that is that two words sort of collide. And on the one side we have the word, all of you are familiar with, namely the word of graph drawing software. So graph drawing software say graph with what you do is you specify a graph and then you graph with some -- produces a great layout. I think the perfect way to draw this particular tree. But as you also notice, when it comes to things like mathematical stuff inside a node or so, it's not that great. And this is something that most have the software is [inaudible] because graph drawing software is geared up at computing good layouts. On the other hand we have another word, the word of type setting, TEX in this case, and TEX is certainly great at producing things like integrals and two pi. Also as you'll notice TEX comes from graphics packages, and they are great at producing say having the same colors as the main document, stuff like that. But, I mean, TEX is not a graph drawing software, so when it comes to computing a layout, it does something, but it certainly doesn't look good. What you really want is that. So you want the layout that is as good as what your graph drawing software does, but you want the power of TEX and graphics package that allows you to draw the names of this particular case. Now, this is a real problem. And to get there -- and graph drawing in TikZ has one possible solution to that. So the other way is to do this, but here what is done is you take an existing document description language, in this case TEX. You could use other once. And you take an embedded graphics description language, in this case TikZ. And I'm going to talk more about six in a moment. But so the point is take an existing system that is good at doing type setting and then the idea is you add something, some syntactic extensions, some options that allow you to specify graph easily and then do the whole graph drawing, not in separate software but really as part of this document processing. And if you do it, I'm going to show you in more detail how that works. What happens is that first of all, because now TEX is running the whole thing, nodes and edges, all the styling stuff is going to be exactly the same as in the main document. What's going to happen that the graph drawing algorithms will profit from the fact that TEX knows very well how large your boxes are, what the exact sizes are, stuff like that. And they are no longer an external program. So the workflow is pretty fast. You just [inaudible] TEX document and the graphs will directly be put in there. And another aim of this whole thing is now if you want to implement a new algorithm, you can sort of concentrate on the algorithmic aspects because this whole framework, all this styling stuff and how to draw it and computing size, all that is completely taken care of by the framework. And you sort of focus on the algorithmic aspects. So this sort of the promise behind this. Now, in the following, I want to show you three things. First of all, how do I use it? So how do I use this graph drawing in TikZ to draw a graph? And then I'm going to talk a little bit about the magic behind it, so how do I implement it? And then suppose you have a new graph drawing algorithm. And in this conference I saw lots of them. So suppose you want to implement that. What do you have to do? And I'm going to show you a very tiny but complete example of what you would have to do. Okay? So that's the idea. But first let me show you a little bit on how to use this. Now, graph drawing in TikZ, I presume not everyone knows what TikZ is. So here's my two slide introduction to this. The idea is -- well, you have a TEX document and somewhere you say use package TikZ, so somewhere in the beginning. And when you do that, a large package of TEX macros gets loaded and the new command becomes a way level called [inaudible] TikZ. And now what you can say is -- now, in the middle of your TEX document when you TEX it, this is going to come out of it. And as you can see, it says well I want to fill a red something with some red -- some origin that should be a circle, and weight here should be half and oh, X hard, that's TEX speak for the height of an X character and because the way this is half of it, we are going to get something that is as high as a normal X character. Okay. Now, what TikZ does is it scans this thing and then TEX does lots and lots of pausing and transformations. At the end you get very low level primitives for producing PDF if you want PDF or PostScript if you use normal or even SVG if you want certain versions of TEX. So whatever you want, that is directly produced [inaudible]. Okay. So that's TikZ on one slide. Now what is going to be important for this talk is that TikZ also has certain support for nodes and edges. I mean, this is about graph drawing. And this is what TikZ does. You can say, hey, I want a node, let's call it A, at a certain position on the page, and it should say hello there and has a shape called rounded rectangle and another node has a tape shape and a circle and a diamond and so on. And then there's a certain syntax to add edges between all of these guys. Okay. So this is what the package can do. All of this is implemented in TEX. And now the point is graph drawing -- well, graph drawing is all about getting rid of this edge stuff. So we no longer want to specify coordinates by hand, which is -- takes a long time and it's very hard to get if the graph gets bigger. And this is what graph drawing in TikZ office use this. So we can now say, hey, I want to load a new library called graph drawing, essentially, and then a new option sort of pops up called layered layout. And what it does, you just add it, and then you get rid of all the edge, so you're no longer allowed or you shouldn't specify any longer where the nodes should go. Because this is now the job of this particular option. When you want it, what it's going to, one, in this case, the Sugiyama method for computing a layout for these guys and it's going to look like this essentially. And if you, instead of layered layout use another option, say a spring layout, then, well, what's going to happen is you get this typical spring layout because now spring layout would be one in the background, and you can configure these to death with things like node distance and all sorts of other things that can specify that will be taken into account for join these graphs. Okay. So this is basically what you do as a user to use all of this. And before continue and show you how all of this works, I would also talk a little -- like to talk a little bit about syntax. And the point is that all of this, this graph drawing in TikZ is aimed at human beings mostly who want to simply write down a little bit of code to get a graph drawing like this insides the TEX document. Now, why do people use TEX? Because you wonder about that. I mean, it's not such a great language at first site. But the point is when you want something like say C squared, what you have to write down is dollar C hat 2 dollar and, and that's it. It takes about a second. If you want to do the same thing, say using Word, then you have to open the formal editor and then do lots of clicking, takes a long time. It's really fast to write this down because it's very concise. So what is great about TEX is the concise syntax. And we can see here that's not particularly concise. I mean, it takes a lot of space to specify a simple graph. And because of that, turned out really make graph drawing TikZ using we need a new syntax. And so what the system comes with is this. So I have a look at the different syntax available. And in order to specify by hand the chosen syntax, well, basically is based on dot. Because the dot notation used in graphs, that's much more concise, much more easy to use. And it turns out that the way the pauses work it's hard to pause dot is with [inaudible] it does say -- the [inaudible] is a little bit of mixture of the philosophies of dot and whatever TikZ does. But if you have a simple dot text like this one, it's going to work exactly the same you expect, you know, hello world, C, dollar, C squared, delta and so on. And let me just spends one slide on perhaps the differences between the normal dot and what this syntax now does. So the key features first of all, you can suffix all your nodes simply in square brackets by options that you want to add, so the hello node, type node, word node, as before. So in order to get this drawing we had earlier you want this now. Another interesting thing is which I designed of prefer over what dot does is you can add edge options following the edges. So you say well, I want this edge from word to delta, it should be dashed. And it should be blue. So you just add it at the edge. And another edge from delta to hello should bend a little bit to the right, and should have some text on it. Yeah. Stuff like that. What's also interesting, there are two additional edge kinds. So a backward edge and a bidirectional edge. And the rationale for that is we had a talk earlier actually yesterday where it was pointed out that if you want to decipher removal, it's good to know which edges you have to -- what you have to -- which arrows have to be put in the other direction. And this backward edge is sort of communicates to the algorithm that would be good idea that -- to reverse this one and define the output. Okay. And finally because this is for people who want to draw graphs directly inside TEX there's also good support for trees because they are pretty important. So you can say I have a root -- well, it has a left child and a right child. The left child has a one and two children. The right one, well, it has one child about us has no left child, but a right child. And then say it's a binary tree layout and they get something like this. Okay. So there's more to the syntax but at this point I'm going to stop this and spend the rest of the time to show you a little bit on not how you use it, but how it works and then how you implement your algorithms. So, yeah, graph drawing in TikZ. Well, TEX is really a great program, but implementing any sort of advance algorithm is absolutely impossible directly in TEX because it's too incomplete. But that's about it. So if you want to do something grand like the Sugiyama method, you won't be able to program this in TEX. However, there's hope because there's another language called Lua, which is small, simple, elegant, nice function language. And that has been integrated into modern versions of TEX. Now, most of you will actually be using Lua TEX without notifying because it's just moving in that direction. Just click on TEX. What happens Lua TEX one and that's because all it does is essentially offer this one new command. So Lua TEX comes with the command called back slash directlua. And when a TEX document just -- when it encounters directlua what happens is that TEX sort of stops, hands over control to this Lua kernel which is about 40 kilobytes, it's very, very tiny, and what it does -- well, as you can see this looks like normal program code more or less. We have a sum and a for loop from 1 to 100. We add up these numbers and then tex.print means okay whatever comes out we turn it book to the TEX stream so -- and this is if you want this by a normal TEX you're going to get this output. And this is really much, much nicer to program because try to do the same thing in TEX, it's possible but you have to really know how to do this. Okay. So this directlua option is really what's behind this whole graph drawing thing. And how a graph is drawn. So let's have a look. So on the TikZ layer you say, well, I want a graph with a tree layout. And this tree layout option, and it does essentially is trigger a call using directlua to something called begin graph drawing scope. So it calls this framework. And then at that point, when we see A to B to C, we're going to create -- now, TikZ is going to create the three nodes with all these nice -- it's going to render them, put a shadow behind them, whatever. But instead of inserting them into the page at that point, instead we again use directlua to add the nodes on this lower layer. And that continues until the graph is done. And then we get a cal to run graph drawing algorithm, again using directlua. At that point, sort of on this Lua layer a object oriented description of the graph will have accumulated there. And then we load and run the algorithm. And as you can see, all of that happens on the Lua layer. So here you do not have to worry about tech at all. And these algorithms I'm going though show you in a second, they don't see TEX. What they see is an object oriented model of the graph. So they run and then they compute new positions and then at the end diagraph drawing scope, they use sort of callbacks to tell TikZ now I know, please place the node you have precomputed there on the page. And then what is see what comes out of it. So in order to implement a new algorithm, what you need to do is go into this load algorithm and run it. And this is what the framework does. So what do I have to do? And, yeah, so how does that work? Well, the idea behind this is to treat graph drawing as very traditional. But what the systems also do to treat it as a transformation starting with some graph and then you transform it, transform it, transform it, transform it, and then at the ends have the a drawn graph. So this is what happens. And TikZ really follows this philosophy. Because if you have a new algorithm you sort of declare okay, my algorithm, well, it wants a tree. And if the input isn't a tree then the framework is going to make sure it is. So if you feed in a click, then a spanning tree will be computed and the algorithm's only going to see that. But it does something with it. And it can also say at the end, okay, I'm done, but then the framework will continue to transform it further until we have the drawn graph. And I'm going the show you this on one complete graph drawing algorithm. So this is what you would really have to write down. This is an algorithm that is going to place nodes on the circle. So something very, very simple. It has to fit on one slide. But let's have a look at what happens. So you create a new file called, say very simple demo.Lua because it's written in Lua. And then you start with something like graph drawing new algorithm class. So I want a new algorithm. And it has one property, works only on connected graphs. So because of that property, the framework knows it's only going to feed connected graphs into that algorithm, then into this run method. Now, if the graph is not connected, the prescribing will decompose it and then run it on the different components. Well, now, I don't want to go into all the details, but essentially you have the graph object here that can read the radius from whatever the user configured. And you have an angle alpha which is 2 pi divided by the number of vertices. This is Lua speak for iterating of all the vertices and essentially while the vertex position the X and Y position that the cosine and cosine. So they're going to replace on the circle. And then there are some quirks of Lua. So this is what we put. This is a complete graph drawing algorithm you put in some file. And the moment you do that what you can do next is use it. And like this. You say TikZ graph and I want the layout equals very simple demo. That's the name of the file. And this is going to come out of it. So this is really what I did here with the radius of one centimeter. Let's have a look. This is the specification of the graph and that syntax. And as you can see if you have a close look at it, this is not a connected graph. So because we said works only on connected graphs it was decomposed by the framework and then the algorithm was the one first on this connected component, on this connected component and instead that were placed on circles. And, yeah, I mean, in this case you could argue, well, I mean, why does it have to work on connected components? Because we can also place non-connected components on the circle. But the point is just to demonstrate this, you know, that you can ask this. Now, I said that we were also post processing the framework does so let's do something interesting. Add an option called orient right. So say this edge has the option should go right. And instead now what the framework does it's going to rotate this graph so that the edge from A to B now goes right. And notice that the algorithm didn't bother about that at all, didn't even see that. Another thing we could do now -- just give you some examples. Here let's add some options called stub. I was inspired by this other talk to turn this drawing to stub drawing. Again, the algorithm went notice because this is done by the higher layers of just rendering these edges in a certain way. And finally here at lots and lots of other options and then you get you know nodes with shadows and whatever. But the point is that the graph drawing algorithm doesn't have to worry about that. Your graph drawing algorithm is this. That's it. And all this other transformational stuff is getting to be done by the framework. Okay. So let me conclude. Graph drawing TikZ is on the one hand aimed at users. Most of you people presumably want to draw a graph with, say, up to 100 nodes. Otherwise you won't be able to fill it on the page inside a TEX document. And you just want to use it. On the other hand, it also addresses you as a researcher if you have a new algorithm that you just want to try out, the idea is you have to write very little code that is then going to be useable in wide variety of context automatically. You don't have to worry about anything else around that. The impression was there already because very new thing. We have essentially Reingold-Tilford for drawing trees. The whole layered Sugiyama method was implemented by a student of mine with it's configureable to death. And then we have multi-layered force-based algorithms that also implemented, although they need some improvement, in my opinion. If you want to use it it's available as part of the -- of TikZ itself. The development version you have to download this from source forge or check it out. But actually it's going migrate to your computer sooner or later because being part of TikZ it's going to be part of the next TEX distribution and the next TEX distribution is going to be on your computer at some point. And that concludes my talk. Thank you very much. [applause]. >> Lev Nachmansen: Thank you very much, Till. I guess if there are short questions. We won't have time for too much. But let's start with Walter. >>: Is it possible to [inaudible]. Suppose I have an algorithm in [inaudible]. >> Till Tantau: Yeah. So in principal it's possible to call an external library because Lua allows that. The only reason why this is not yet implemented, it's not because it's so difficult because it sort of breaks the idea that if you have this very simple demo load you just give it to someone who can run it immediately. If you have a C code what has to be compiled, has to be distributed, target all the different platforms so that's, yeah, hard to do. And it's not as portable as this pure TEX version is. But other than that, yes, you can do this. It would need some improvement [inaudible] causing this and how to do this was [inaudible] and in principal, yes. And certainly when it comes to things that are very time intensive you should do that, I presume. >> Lev Nachmansen: David? >>: Is it possible to run this on servers that expect to receive TEX code from untrusted sources. Or does the use of Lua make such as archive ->> Till Tantau: Yeah. >>: Or does the use of Lua make this too insecure? >> Till Tantau: No I think -- I mean, the whole TEX thing usually runs in sand box so, yeah, I mean, you can figure TEX how much you're allowing Lua to do and [inaudible] won't be to call other things. Actually it's -- let me phrase it this way. It's easy to configure Lua in such a way that you can run it very securely on any server you want. >> Lev Nachmansen: The very last question. >>: Is there a way to are use the result of the previous computation, like [inaudible] index or do we have to [inaudible] run the algorithm again? >> Till Tantau: So there are two answers to that. One thing is what is already built into TikZ is then, one, it sees a picture and the picture hasn't changed, then this externalization [inaudible] is going to write it to a PDF and then reinsert it way quicker. So that works by default. So actually for graph drawing what you really like I think is that you get a representation of a graph, and then the lower layer should notice oh, I've seen this graph before so I don't need to run the algorithm, I have a repository that's not implemented yet but you could do it. I mean, because my students say this takes so long is that you have why don't you cache it, oh, yes, good idea. So you could do it, but actually for this talk and also for the final version of the paper, I use this externalization log which worked very well and don't notice at all. >> Lev Nachmansen: Okay. So there is a large lunch break after the session where you can discuss many more questions that you have. So let's now continue with the second talk. The speaker of the paper that was planned is unfortunately not here, but we have a wonderful replacement with Nishat. So please we're now starting the point-set part of this session. >> Rahnuma Islam Nishat: Hello. I'm Nishat. I'm presenting the paper Kinetic and Stationary Point-Set Embeddability for Plane Graphs. This is work by my colleagues at U Vic, Zahed Rahmati, Sue Whitesides, and Valerie King. So we all know what point-set embedding is on a stationary point-set. So we have a set of points that do not move and you have a graph and you have to map the vertices of the graph on this point-set and draw the edges in a way that no two edges cross. So we map the vertices here and then draw the edges. So that's an embedding of these plane graph. Now, what happens if the points move in a predictable trajectory, like we soup that no three points are collinear in a positive interval of time, and we also can have the trajectory expressed as an algebraic function. Then what happens? That's the question that this paper asks and try to answer. So these are some related works. There is some works on kinetic proximity graphs, closest pair, Delaunay triangulations, Euclidean minimum spanning trees. These are the references. Guibas, et al., Basch, et al., Rahmati, et al., and Abam, et al. And we know some points of embedding works by Kaufmann and Wiesel, by Bose, et al., Di Giacomo, Cabello, Biedl, and recently Durocher et al. But there has been no results merging these two branches. So this paper is the first try to merge kinetic data structure with point-set embeddability problem and it introduces that data structure here and an algorithm for 2-bend point-set embedding. So the kinetic framework of this graph can be expressed like this. So for any four points at any given time, the point PI should not be inside the triangle -- any triangle created by three other points and it should not create any crossings. So to maintain these properties, they define a set of certificates that certifies the validity of the point-set embedding or the mapping at any critical time. And a critical time is when an event occurs so that we might have to change the mapping of the vertices to the points. So one example of such a certificate is shown here. So certificate is at any given point that point P3 is not inside the wedge P2. That is the wedge made by extending the edges P2, P1, and P2, P4. So we know that the point P3 is moving. And what happens when the P -- point P3 moves inside the wedge? If it's inside the triangle and there is no crossing it, then we change the mapping like this. So now P2 is mapped to P2 and P4 is mapped to P3. And we change the edges like this. And now we also have to remove this certificate and insert a new certificate that says that P2 is not inside the wedge P1. So the same thing goes for this case when P3 is not inside the triangle but it moves into the wedge and creates a crossing. Then again you change the mapping and form a new certificate. Okay? So how do you measure is performance of a kinetic data structure? There is some standard measures. You can -- a data structure can be efficient, responsive, compact, and local. So the efficiency means it's the ratio between internal events and external events. So internal events are events when the target attribute is not changed. That means the mapping does not have to change. And an external event always changes the mapping. So you have more external events, then it's a good thing. And also the responsiveness means the processing time of each event. And the compactness is the side. And the locality shows that when there is a change in -- in some mapping you don't have to change the whole thing, you can just make some changes locally and that keeps the certificates valid. So first we talk about the 3-bend drawing algorithm. In this algorithm -- it's on stationary points now but later I'll show you how you can convert this algorithm to and algorithm that keeps emitting valid over when the points move. So first you have to order the point according to their X coordinates. So P1, P2, up to P12. And then take the graph and find a Hamiltonian cycle here where at least one edge has to be an outer edge. So actually what they're doing, they're taking the algorithm of Kaufmann and Wiese, but they're making a slight change which does not improve the bound given by Giacomo, et al., but this change help us to keep the embedding intact or keep the valid embedding on the moving point-sets. So to get the Hamiltonian cycle, we need some dummy vertices like V1 and V6. This edge has been subdivided once by the downward vertex Z1, and then we add the edges Z1, V8 and Z1, V7. Next what we do, we map the vertices V1, V2, V3 on the Hamiltonian on the point-set. And when there is dummy vertex between here you 10 and 11, there -- we have to take the middle point of the line segment P1 and P11 and insert a dummy point there so that we can map the dummy vertex. So here's the Hamiltonian path. And the next thing is you have all the internal edges that is inside the cycle and the external edges that is outside the circle. And you put the internal edges above the chain and map the external vertices -- sorry, edges below the chain. And you have a bend for each edge. So the difference in this algorithm is assigning the slopes here. So for each edge you assign this slope. This and this for the two segments. So one is 1 plus D over N plus N delta, and the other one is minus 1 plus D over N plus M delta. And where D is the distance between the points. So, for example, P1 and P9 has distance 9 because there a dummy vertex in between. And M is the number of total dummy vertices. N is the number of vertices. And delta T is the maximum slope of the consecutive edges of the cycle on the Hamiltonian path that is shown by the bold chain over there. So this delta is a function of time. So it changes over time when the points are moving. So how can we keep track of the maximum slope? That's why we need these dynamic and kinetic tournament tree. So all the leaves contain the slope of each edge on the chain. And it's a binary tree, so the parent gets the maximum of these two. So the root has the maximum of all the slopes. And why do we need the tree? Because we know that the slopes are going to change, and I'm sorry we have to remove some slopes and insert new slopes. For example, in an order event. So an order event occurs when the related position of two points changes. So suppose that time T minus QI was to the left of QJ and at some point QJ came to the left of QI. So now there are lots of crossings. So what do you have to do? We have to map -- change the mappings so the vertex that was mapped on QI is now mapped on QJ and the vertex that was mapped on QJ is now mapped on QI. And we change the incident edges. And we remove the previous slope so here we have to remove this edge, this edge, this edge. So we remove those slopes from the tournament tree. And then we insert three new slopes and change the tree structure. Now we have the 2-bend drawing and using the dynamic and kinetic tournament tree you can keep the embedding plane when the points are moving. But what about getting a 2-bend drawing from the 3-bend drawing? So you get the third bend when you have a dummy vertex. So you -- if you draw an edge from there to there, you just go 1-bend, 2-bend, 3-bend. So we want to save a bend by drawing these two segments on a straight line, a vertical straight line so that we have only two bend at most. So you see that we change the -the two line segments into one vertical line segment. But that creates some crossings. So we have to rearrange the slopes or have-need a way to calculate this slope so that there are no crossings there. For that we need a nested tree. So what is the tree that is also on the edges? So I think I forgot to mention that this is always a triangular graph. So the leaves of the tree would be the edges where the endpoint has distance 2. And it's a binary tree because it's a triangulated graph so its internal node would have at most two children. And it would draw the tree like this. Now, in this tree, for each edge we store two values, one for the left slope, and one for the right slope. So if both the end points ar's not dummy vertices, then we just point delta and minus delta. Just to remind you, dealt is the maximum slope on this chain. So that's the same for this one. But for that one, we can put delta and minus delta. Because the right end is a dummy vertex. So what we do, we draw a vertical line there and extend this segment so that it intersects. Then the parent of this node we get the right -- in this case, the right end. And connect with the intersecting point. And the slope of this line is alpha. So for the right segment anything that goes to the right of Q7, the slope has to be at least alpha, minus alpha. So we store delta and minus alpha here. And when we go to the internal node for the left value we take all -- all the values and pick up the maximum. And for the right value, we take the absolute values of all the children, the right values -- absolute values, and take the negative of that. So it's delta minus delta for that, delta minus alpha there. And for the root node delta and minus a maximum of 1 delta. So once we have this tree all constructed, we just assign slopes like this. So for this one, it's a 1 plus 2 over 8 delta. 8 is the number -- total number of vertices including the dummy vertices. And the distance is 2. And we have [inaudible] slopes like this. Here the left slope is 1 plus 2 over 8 delta but the right slope is just infinity. And it goes on like this, like that, and that's the 2-bend drawing of the graph. So if we analyze the performance of this data structure, for the 3-bend drawing, it uses linear size. And for the 2-bend drawing the tree uses linear size 2. So both of the data structure in both algorithms are compact. But in the first case, in 3-bend drawing the algorithm process total these number of events. That's a very big -- bigger. And each event is processed in order of log square N times. So that's a responsive and efficient and local. But for the 2-bend drawing we can't maintain all those properties. So it's only compact. But it's not very efficient, not very responsive, and not local. So for a slight change you might have to change the whole graph embedding. And for future work, as we have already shown, that the data structure for the second algorithm is not as we want it. Of the so we'd like a performance -- a data structure that satisfies all the standard performance criteria. And also we did 2-bend drawings, 2-bend point-set embeddings. So it would be nice if we were could do that -- the same thing for straight line drawings and moving point-sets. Thank you. If you have any questions I'd be happy to answer if I can. [applause]. >> Lev Nachmansen: Thank you. Wonderful. Not being an author and giving such a good talk. Wow. >> Rahnuma Islam Nishat: I practiced. [laughter]. >> Lev Nachmansen: Are there any questions? >>: [inaudible] 2 bends. In the session you have [inaudible]. >> Rahnuma Islam Nishat: Yes. >>: [inaudible]. >> Rahnuma Islam Nishat: Yes. >>: Can you use that approach here [inaudible]. >> Rahnuma Islam Nishat: I think you can use it, but just to maintain the tree, I mean, when the points are moving, I think this is much easier. I think, yeah. I saw the paper, and I think that can be used. But just from my opinion, I think using just -- just keeping track of the slopes and assigning the slopes when the points are moving just recalculating the whole -- the slopes of all the edges that is easier. Any other questions? Oh, yes? >>: Yeah. So have you considered or is it difficult to consider a [inaudible] version of the problem where some of the [inaudible]. >> Rahnuma Islam Nishat: I don't know if they have thought about it. So I'll relay your suggestion to them. That's a very interesting problem. >> Lev Nachmansen: And I think it's the perfect transformation to the next paper, which exactly deals with colored point-sets. Thank you again. [applause]. >> William Lenhart: Thank you very much. I'll be talking today about some work on colored point-sets to answer [inaudible] question, well placed since he's one of the co authors here. This is work with Fabrizio, Marc Glisse, Giuseppe, Tamara and Nishat. This work was begun at the most recent INRIA, McGill Victoria workshop on problems in computational geometry. So I'd also like to thank [inaudible] for organizing that and inviting us down. Sadly, don't have any moving point-sets, at least not intentionally moving point-sets, but as a bones you will see many examples of the consequences of not having your graph drawing system well integrated with your type setting system. So you can look forward to that. So here's an outline of the talk. I'll set up the problem which will take no time because you all know what graph point-set embeddability is. Talk briefly about some previous work. Outline our results. And then hope to focus a little bit on some of the highlights of some of the proofs. And then with some open problems. Okay. So there's a graph, there's a point-set. There's some drawing constraints. And there's -- that's graph/point-set embeddability. So there's been a lot of work in this area. A lot of theorems have the following form. You give me some classic graphs, you give me some kind of constraint on your point-set like maybe it's convex or maybe they're in general position, some drawing conventions and then you try to see something interesting. And many people have succeeded at this game. Results on outer planar graphs, NP-completeness results on planar graphs, NP-completeness planar graphs on with bends. So that's the basic game. But then you can have variance of the basic game. And one is with respect to universal point-sets. So here you have a class of graphs. And you look at all the graphs in that class that have a fixed size and vertices, and you want to find a set of points upon when you can embed all of the graphs of that size. And of course there's been work done here too. I guess that's easy. For planar graphs you can draw them on a 2N minus 4 by N minus 2 grid and you can do it efficiently. That was later improved to a slightly smaller grid and a slightly faster algorithm. So that's one variant. And we'll come back to that later in the talk. Another variant is to try to constrain the assignment of the vertices to the point and the point-set. And so one version, this is called embeddability with mapping. So now you add a bijection of the vertex set to the point set, and you try to get an embedding on to the point set that respects the bijection. So boom, boom, boom. And one of the better known results here has to do with planar graphs arbitrary point-sets and drawing polyline embeddings that don't have too many bends per edge. And that can be done efficiently. Well, if you don't want to constrain your drawing too dramatically, you can instead color the vertices of the graph, color the points in the point-set, do this in sort of a compatible way so that if you have, you know, 17 red vertices, you have 17 red points so that at least I have a chance of respecting the coloring. And then ask if you can embed so that the color classes are preserved. Graph point-set embedding and kind of minimum result there. K colored planar graphs. You can do this with the polyline embedding so that you don't have too much bends per edge. Okay. So that's some of the background. In our work, we focused on trees. We focused on 2-colored trees. And in this case it looks like it's a properly 2-colored tree, but they won't always be. And I have a 2-colored point-set you want to embed. So we call this a bichromatic embedding if you respect the coloring of the graph in the point-set. Sometimes it can be hard, even for what seems like a very easy problem. So here we have a properly 2-colored tree. We have a convex point-set. And we want to embed. And it turns out that that problem ends up being NP-complete. So if you try to make it easier, you can further constrain the point-set. So if you require that the point-set not only be convex but alter alternating in color, then it finally becomes easy. You can determine in linear time whether there's such an embedding. Okay. So those are two of the results on embedding trees in the convex point-sets. Then we looked at universal point-sets. We wanted to find bounds for the size of the smallest 2-colored point-set P that would be universal for all bichromatic straight-line embeddings of all N-vertex 2-colored graphs. And we got an upper bound that's a pretty simple result. You might think about it for fun if your mind starts to wonder in the next few minutes. We have a lower bound that's a little more interesting. We can show that any such universal points that will have to have at least three has N vertices minus a little bit. You could probably quantify that little bit but we were a little lazy. So that's the last slide in a nutshell. If the tree is properly colored, then, in fact, you can improve the bounds a little bit. You can get lower bound 7N over 6 minus log of N and upper bound of 4N over 3. Okay? So that's some information on universal point-sets. And finally we looked a little bit at polyline planar embeddings. And what we did was we looked at point-sets that were linearly separable. And we were able to show that if you have a 2-colored tree and a compatibly 2-colored member. Compatibly just means the colors add up properly. Planar point-set that is linearly separable then you can do a 1-bend bichromatic embedding on that point-set. So those are the results. And what I'd like to do with my remaining time is look at a few of the highlights of some of those. Okay. So we need a little bit of notation and one or two known facts. So all we really care about on this slide is this tree on the left and the numbers that are labeled on the vertices. So the idea behind these numberings, the label on the vertex -- and think of this as a root the tree for now, is called the surplus of the vertex. And it's basically trying to tell you by how much the color of the root node is winning over the other colors. So if you look at this tree, there's one more red node than blue node. So this gets a 1. Of course least all get 1s because they only have one node and their color wins. If you look up here, this blue node got a negative 1 because it's actually running a deficit colorwise with respect to its subtree. This subtree is nicely balanced. So a rooted tree is called balanced if none of these numbers are too big, if they're all between negative 1 and 1. Okay? And a tree is called color balanced if you can pick it up by some vertex and make that the root and it's balanced from the point of view, that root. Okay. So we're going to be thinking about these balanced trees a little bit. Another fact that's useful to know is that if you have a straight line embedding of your tree on a convex point-set and you look at the subtrees you get by deleting a vertex of your tree, then the subtrees that are remaining are all mapped to consecutive points of the point-set. So there's one of the subtrees, there's another one, there's another one, there's a tiny one. Okay? So we need those facts. All right. So I'd like to give you a idea behind the proof of the following theorem. This says that any properly 2-colored tree can be embedded on a convex alternating point-set if and only if the tree is color-balanced, our previous definition and you can check that color-balanced property pretty quickly. And I want to talk about why color-balanced implies embeddable. And the idea here is pretty simple. What you want to do is you want to take your tree, root it as a vertex where it's going to be color-balanced and then kind of from the bottom up build a one 1-page book embedding of that tree that has some properties. And I can list the properties for you. Boom, boom, boom, boom. But it's probably better to look at them on the next slide. So basically when I look at my tree V and I look at its subtrees, each of which has some root, they're going to fall into three categories. Either the root has a surplus 1, so it's got one more blue than red in this case, so it's going to alternate. And what we want to make sure is when we embed it with the 1-page embedding the root can see up to infinity so there's no edge crossing over it is. Here's another possibility. The root had plus zero, same number of reds and blues. And here's the third possibility where it had surplus negative 1. So from these building blocks we just want to be able to add V to the 1-page book embedding. And it's not surprisingly pretty easy. What you do is you first note that you're going to have the same number of type C1 trees, that is ones with the blue surplus as trees with a red surplus because after you removed B, since V had surplus 1, you have the same number of red and blue vertices in all those subtrees. And so you're going to have the same number of class 1s as class 3s. And all you really have to do is alternate class 1, class 3, class 1, class 3, and then throw in all your class 2s at the end and then put V on the left and attach it like that. So you can build the graph that way. Okay? So that's one of the problems where determining the embedding is actually pretty easy. Now, if you just drop the alternating constraint from the theorem, then all of a sudden it becomes a much harder problem. So probably 2-colored tree, just a convex point-set, it becomes difficult. And the idea here is that you're going to reduce the problem to a special form of 3-partition. Letter so let me just quickly remind you what 3-partition is. You're given an integer B, positive integer B, a set A of positive integers. There are 3M of them, a multiple of 3 of them. And your goal is to construct disjoint point-sets -- disjoint 3-sets from the set A, each of which has its elements sum to B. And the fact we appreciate about this problem is that it's strongly NP-hard, so that even if B is bounded with respect to the size of the elements of A, and, in fact, even if each of the As are even, this is still on NP-complete problem. So what we want to do is take an instance of this version of 3-partition, build a tree, build a point-set, and show that embedding the tree on to the point-set means that you can satisfy this 3-partition problem. Okay? So here's how we do it. For each element A, we have an alternating path of length A sub-I. So length A sub-1, length A sub-2, and so forth, attached to a root. We then have a bunch of trees that are going to help anchor other parts of the tree. So these M trees over here we call them star trees. The names are not very creative. Send suggestion, so if you have better ones. And there's a special tree over here that's going to anchor the root. This value A is just the maximum value that any of the elements of the set A takes on. So you need these to be large enough that they can do the job of anchoring the tree into the point-set that we're going to build, okay? And in the point-set the goal would be to have these paths cluster in groups of three on the point-set and they're going to cluster into bins of size B. So that means that each said of numbers will add up to B. Okay. So there's the point-set. The root's going to go there if we're lucky. You can see right here that was that rightmost red star tree we called it. That's going to let us anchor the root where we want it to be. This is an example of a bin. It has B alternating red and blue points. And this is one of those M star subsets that separates a bin from the next bin, and these just go around like that to there. Okay. And as it turns out, if the 3-partition case is satisfiable, these paths will nicely fall into the bins and the root will fall there, and everything will work out lovely. And if, in fact, you can embed this on to this point-set at all in a planar straight-line way, then again it will embed so that three paths are in each bin. That completes the little outline of the proof sketch. Finally I wanted to talk a little bit about universal point-sets for 1-bend embeddings. So here are the ideas. We're given a 2-colored tree, and we're given a 2-colored point-set. And the only thing we ask for our point-set is that it be linearly separable. So there's a line with all the reds on one side and all the blues on the other. And if that's the case, then we can embed the graph -- the tree on to P with at most 1-bend per edge. I wanted to give you a sense of how that goes. Two-step process. The first step is we transform the problem into a 2-page book embedding problem. And then we show you how to embed your tree on to that, the 2-page book embedding. All right? This uses a result that Di Giacomo, Liotta and Trotta, and the result is the following: G has a bichromatic 1-bend embedding on P, that's just what we're looking for, if and only if there's some line, L, such that G admits a bichromatic 2-page book embedding and then some stuff in red. So the stuff in red, consistent with sigma LP, well sigma LP is an ordering that the line L imposes on the points in your point-set. And so you just want the bichromatic 2-page book embedding to be consistent with that ordering. And so here's -- by way of example, here's a point-set. There's the line. Proceed ject orthogonally down. That gives you an ordering on the points. And so you just want your -- you just want G to have a bichromatic 2-page book embedding that has that pattern of colored points. Okay? So that's what we're going to aim to do. All right? And the way we do that is we take our point-set, which is fortunately linearly separable. We take an appropriate separating line so that when I look at the perpendicular bisector, the points project nicely down on to it. Just nicely meaning no two points end up in the same place. And you'll notice that what will happen in this case, you'll have all the reds on one side of this portion of the line and all the blues on the other. And so what we're going to do is show you how to embed your 2-colored tree on something that looks kind of like that. But great. Thanks. And I just thought I'd walk you through an example. So there's a tree, 2-colored. The idea here is that we draw it on to that point-set top down kinds of one level of monochromatic trees at a time. So first we'll draw that red tree on to our spine. Then we'll draw those blue trees. Then we'll draw those red trees, then we'll draw those blue trees. So you can watch it happen. We start over with the red tree. You can see it over there. And then we sneak down the bottom page. And then we draw the blue subtrees and then we jump over the top page, we draw the red ones and it's really pretty just that easy. Okay. So that's a flavor of some of the ideas that were involved in the proofs of the results. There are, you know, countably infinitely many problems of this type, at least. And here are three chosen not quite at random. If you think back to those decidability results, we're still looking for, like, the easiest hard problem. All right? And so one candidate for that would be assume that your 2-colored tree is a binary tree and that your P -- point-set P is convex. In that case is it vast or is it still NP-complete like it was for the non-binary trees? We don't know. Can the bounds on the sizes of the universal convex point-sets be tightened? Might think there's a good chance they can be. And what if you don't constrain the point-sets quite so much? So convex is a pretty heavy constraint. You know, you could say they're in general position, you could -- you know, you could say that they form two or some finite number of convex curves. But we know very little about this. So those are some of the problems that we've thought about. These are some we'd like to think about. And thanks for listening. [applause]. >> Lev Nachmansen: Thank you. There's time for a couple of questions. Or not. >>: I have one. >> Lev Nachmansen: Joe. >>: So if you can go back, I'm just curious [inaudible] and then you [inaudible] points, the red and blue points. But how -- how does this -- yeah. So how do you go from the [inaudible] here thing to embedding on it to ->> William Lenhart: The original point-set? >>: Yeah. Yeah. >> William Lenhart: Oh, yeah. So you appeal to the theorem that I mentioned here. It says if you have such a book embedding you can do it. You can thank the man behind you for that result. Any other questions? Okay. >> Lev Nachmansen: Thank you. >> William Lenhart: Thank you. [applause]. >> Csaba Toth: So thanks for the preparation explaining everything about colored point-sets. I'm going to talk about one achromatic problem for point-set and graphs through it. But the motivation comes from the bicolored point-set from a paper by Flek, Keszegh, Moric and Uljarevic. So they wanted to separate the red and blue points and the bicolored points by a simple polygon. And they could prove that if -- let me see. Oh, not this one. Oh, it's a separate one. So if there are far more blue points in the interior of the convex hollow, the red points then, then it's possible to separate them using only vertices of the blue point-set. And they conjecture actually that way fewer than R to the 4 blue points would suffice. So they conjecture that 2R minus 1 would be enough. But they don't know. For separating the points in a different way they also had this result, that if there are exactly the same number of blue and red points then one can use 3N half vertices for separating the red and blue, if the separating polygon doesn't have to -- can use Steiner points. And what they do is just add wedges to these convex hard incisions and to add any such new wedge, they have to use three additional vertices. But these points are Steiner points, right? So this left them to this question that Filip Moric posed that -- two years ago, that if you are given now a monochromatic point-set, what is the fuse number of segments in a path, covering path that goes through all the points? So if you have a monochromatic point-set like here, you'd like to have path that visits all of them. The turning points don't have to be in the point-set. And of course, if you think about the motivation, the crossing paths would not be what they are interested in. They would want noncrossing paths. And there other question, what is the smallest number of segments that can do this for N points with the noncrossing paths. And so if -- the best possible bound for this is N half, the points are in general position, then a segment can't cover more than two points. And if you can always cover two points with such a path, then the previous bound when separating red and blue points could improve to for just N because such a path could be taken to a small channel where every vertex here would yield two vertices of the separating polygon. So that's the connection. And theory comes our work. We give some bound for these two questions. But let me just mention another motivation, though [inaudible] to the traveling salesman problem. In the classical traveling salesman problem, you are given monochromatic points, and you want the shortest tool that visits all of them. And of course it's NP-hard, even geometric version and there's a P task for it. But there -- it has also many variants. Because it's such a classical problem. These are typically called angle TSPs where you still want to visit all the points, but you want to optimize some other constraint, not the total Euclidean length. So such constraints could be the minimum number of links, minimum number of segments in the tool. This is also known to be NP-hard. So this has been studied 10 years ago already. And there are more variants. You want to minimize the minimum-maximum turns in a Hamiltonian tour or you have angle constraint that tour cannot turn by more than angle alpha and they still want to minimize the total lengths. So I'm not going to talk about any of these variants of TSP. I'm talking about covering paths again and the corresponding version of TSP is just the minimum link covering path problem that asks for a polynomial path that goes through all the points. Vertices could be any -- anywhere in the plane. Don't have to be in those points. So this is NP-hard. It has been -- there are some approximation algorithm. And for which -- for a variant that has been studied a lot is the axis parallel version. They're either -- either you're interested in visiting all points in a grid two, or three or D dimensional grid, and the question is what is the minimum number of turns that are necessary? Of course the number of turns corresponds to the number of segments. And this variant here is -- asks the minimum number of turns for an arbitrary point-set, not the grid. And so this -- for this there are fairly close bounds. So let's get back to the problem I'm going to talk about. So we are given a set of points in the plane and we want to cover them with a path that can turn anywhere, and we are interested in the minimum number of segments and for an arbitrary path an for a noncrossing path. So as I mentioned, the N half lower bound is trivial because a segment can cover at most two points at a time. And here we proved that it's pretty close to the truth if you don't care about crossings, don't worry about crossings. So this -- this is something that we very quickly observed with [inaudible] and Dumitrescu after the question are posed and since then other people also find the same result. It's based on the [inaudible]. It's a simple reduction I'm going to show you anyways. And the other variance, the noncrossing covering path is much harder. It's hard to see anything about this noncrossing constraint. A lot of people tried to give upper and lower bounds since -- in the last two years, since the problem was posed. This is the first known trivial lower bound, something bigger than in half. And I will mention at the end that there are -- the upper bound also has been improved, just very recently. So the two results are the upper bounds where we have a -- we can construct an actual covering path that is not much longer than in half. And for the noncrossing version we have a point-set, a construction that requires long covering path. So let me show these two results just briefly. So as I mentioned, it's based on the Erdos-Szekeres theorem which says that every set of N points contains a subset of at least log N points in convex position. But the proof actually uses is not points in convex position. They use very special points in convex position, caps and cups. There's a recursion for those. So a cap is just -- or a cup on the left is a set of points where there's an X monotone curve and that going through all of them cap is the concave curve. So an obvious observation here is that if this is your point-set, then of course you can just grow segments to pairs of them and align them on the covering paths. So N half ceiling segments will be sufficient. So the Erdos & Szekeres theorem actually have a bound for exactly caps and cups, not for convex sets. And I also want to point out that this obvious observation is actually not true for points in convex position because one could -- if -- yeah. So one could not necessarily continue the -- these two paths. If for instance a cap and a cup is -- cap is odd and the cup is also odd then we could not glue them together. But for caps and cups it works very nicely. So -- and also there's the algorithms, Erdos & Szekeres is a very classical result. There are dynamic program [inaudible] algorithms to compute a maximum cap or cup. So with this observation it's easy to construct the covering paths. So once you have M points in the plane, you can just pick out caps, maximum caps and cups independently and remove them. Until the number of problems points drops below N over log N, then we stop. Now, for every cap and cup we have a optimal covering path, just for K points, K half ceiling maximum 1. And therefore, the remainder point-set we don't really care. There are a few of them. We can just have a Hamiltonian path. And then link them together at the end. So in pictures, this is how it would look like. The point-set we pick out caps and cups greedily and then the remaining points are connected by some paths and they are linked together. So what is the other result? So let me stop for a remark here. The idea was to have a pads that -- a subset for which we have an optimal covering path. So Emo Welzl asked the question that if you don't really care about caps and cups, you just want these type of subsets that -- for which there's an optimal covering path, what can we see? So they called these sets perfect, so set of points is perfect if there is really a covering path for them that -- every single segment covers exactly two points. Actually the points are in general position, otherwise it's not that -- leads to something else. And so he asked what is the largest integer, PN of N, that every set of N points in general position contains a perfect set of this size. So the Erdos & Szekeres theorem gives lower bound of log N, and the -- and as -- that's the best lower bound we have. And this function could be anywhere between N and log N. All right. So let's go back to the -- continue with the noncrossing version where we have a construction for a point-set for which every covering path we have more than N half segments so it's a constant factor is bigger than one half. So this is a point-set where -- with twins, so there are points A and points B. Your points B are on a parabola. And the points B are really, really close to the first points. They are twins. That's how you call them. And -- and they have a bunch of properties so that I cannot list them one after the other. One is that the lines to the twins are almost vertical, not completely because we want the general position. And any two of them meet somewhere below the parabola. So this property just guarantees that we cannot just zig-zag through all the twins in some order that will definitely not be a covering path. So maybe we can zig-zag through one going down and come back and -- but then -- then we cannot continue with another such segment. Okay. And then the distances between the twin pairs increase very rapidly, exponentially in I. So I even have to tell you how exactly. So if you just have two consecutive pairs. So, first of all, so for the last one to the rightmost pair we just put BK a distance that above BK where that is some small neighborhood. And then the -- choose the distances in reverse order recursively. So once we have already a BI and AI, then we choose the next -- sorry. If you have AI plus 1 and BI plus 1, so here we already have this pair, then we can choose the location for BI. So BI should be much, much closer to AI than the distance here. And it should be so much closer that if we connect the A points and the B points then the intersection points of these two almost parallel, seemingly parallel segments should be inside this small [inaudible] neighborhood. So this is always possible. We can just go closer to AI than the distance was before, and the distance is exponentially. And this is enough. This is all we need for the construction. So this property we define it for consecutive pairs. But of course it carries over also -- yeah, if you are careful enough or not very easy then it's easy to carry over to other pairs. So this will be true for any pairs, not just consecutive ones. And then once we have this point-set, we want to say something about the covering paths. So let's take an arbitrary covering path. And it has two types of segments, either a segment is perfect if it covers two points, that's the best it can do. Or it's imperfect. Of course we want to say something about that most segments are -- or many segments are not perfect. So how -- how could a segment be perfect? One option is to cover the twin. Then its segment -- this segment will be almost vertical. And the -- and the -- because of this property of this vertical -- almost vertical segment, the top -- top vertex of this segment will not be incident to another perfect segment. So it either the path continues with an imperfect segment or it's just the endpoint of the covering path. Either one is got for us. So the most interesting -- the interesting -- more interesting case is the other type of perfect segment where perfect segment covers one point from two different twins. Where for instance AI is the smaller one. And then the intuition is that the segment will go very close to -- it will miss one point from each twin. And the second point from the last left twin will be very difficult to cover. So a covering path you have to cover in some way this other point as well. But it has to be very close to the covering path and to avoid crossing it either has to turn somewhere in this small neighborhood or it has to go almost parallel to the first segment and then it has to miss something. So we examined this case very carefully and these are the possible ways that this second point can be visited. If one of the points is covered by the perfect segment and -- I'm not going to go through all these cases, but we conclude from this that the charging scheme that we can exclude that there cannot be -- we can put and upper bound on the number of perfect segment. We show that they can be four times more perfect segment than on nonperfect segments. So that should be charged every perfect segment to one of the endpoints of an imperfect segment. And then we make sure that every such point is charged at most twice. And that -- that gives this factor of two. So we have -- if you combine this inequality to upper bound on the number of perfect segments with just a bound that every perfect segment covers two points and every -any imperfect segment covers just one or zero, that is parameter for 0, 2, then the total number of segments is at least five-ninth's times N roughly. So that's our bound. Let me note here that we don't have a tight analysis, even for this point-set. So we have -- we prove a lower bound covering pats for this particular point-set. Awe know that it cannot go all the way to N if this point-set does have a covering path with five-eighths segments but we don't know what is the -- the lows number. And of course we don't know what is the answer for the question what is the value of G of N. So let me mark that we prove the lower bound for the non-crossing version and this year Daniel Gerbner and Balazs Keszegh proved that the upper bound is some -- a little bit less than N. So they prove that for some positive epsilon it's at most one minus epsilon times N. And let me finish with another problem that for the motivating problem of separating red and blue points it was not really important that the points are covered by paths. A three instead of a path would be just as good, would give just the same kind of improvement. So Balazs Keszegh asked the same question for trees as well. So this would be a covering tree for the point-set with [inaudible] could have fewer segments than for paths, but the bounds are not better. The current known bounds are not better for trees than paths. So I'll stop here. [applause]. >> Csaba Toth: Thank you very much. So are there any questions? >>: Can [inaudible] make sense [inaudible] number of [inaudible]. >> Csaba Toth: Yes. Yes. Then the general position assumption would not make sense. So that will be a -- problem a different type of problem where you need to exploit how -- how degenerate the point-set is. >> Lev Nachmansen: Any further questions? If it's not the case, let's thank all the speakers of this session again. [applause]