Hello all, I'm having trouble getting google to give me anything useful because I don't know the name of the algorithm I'm looking for. line_types
This image shows different ways of connecting two points together, A is just plain lines, C is bezier curves but what is the algorithm that is usually used for B? the double 90 degree bent line, I've googled various different phrases with no luck, most give me smooth curves like C. any information onf the name of the algorithm usually used for B would be helpful, or links would be good too. NOTE: D is not used but there was space in the image so I labeled it anyway.

Dani AI

Generated

Short answer: the double‑90° connector in ’s drawing is normally called an orthogonal or right‑angle (elbow) connector. In diagram editors it’s often the “elbow” or “orthogonal” edge style; in algorithm/graph‑drawing literature it falls under orthogonal (rectilinear / Manhattan) routing. Useful search terms: “orthogonal connector”, “elbow connector”, “orthogonal routing”, “rectilinear/Manhattan routing”. (jgraph.github.io)

Practical choices depend on context. If there are no obstacles a tiny rule set produces B: pick a port on each shape, then route either horizontal‑first or vertical‑first and place a single bend (L) or two bends (Z) as needed. Many libraries expose an “orthogonal”/“elbow” mode that does this automatically. Example heuristic (pseudocode):

function orthogonal_elbow(A, B, prefer='horiz'):
  if prefer == 'horiz':
    return [(Ax,Ay), (Bx,Ay), (Bx,By)]
  else:
    return [(Ax,Ay), (Ax,By), (Bx,By)]

Diagram tools and layout engines commonly provide this style out of the box. (yed.yworks.com)

If there are obstacles, ports, or many connectors, treat the plane as a grid and run a grid router (A or the Lee maze‑router). Find a 4‑direction path between ports, then post‑process the grid path by removing intermediate straight points so only the bend waypoints remain (this yields the orthogonal polyline). A and Lee/maze routing are standard choices for obstacle avoidance on a Manhattan grid. (en.wikipedia.org)

For full graph layout or to minimize bends globally, look into orthogonal graph‑drawing algorithms (Tamassia’s bend‑minimization / TSM framework) or use tools that implement orthogonal routing (Graphviz with splines=ortho, OGDF, yEd, etc.). Those methods are more complex and study tradeoffs like bend count vs. area; Tamassia’s work is the classical reference. (dblp.org)

Note (in response to ): if the goal is simply to draw B between two free points, the heuristic above is usually enough; if connectors must avoid nodes/labels or be optimized across many edges, use a grid router (A*/Lee) or an orthogonal layout routine.

Dear i m not getting u properly wat u want plz xplain ur question?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.