Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6807445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:50:00+00:00 2026-05-26T19:50:00+00:00

Given connected line segments A->B->C->D (A->B is a line segment, then B->C is another

  • 0

Given connected line segments A->B->C->D (A->B is a line segment, then B->C is another and so on), how to find the minimum cost of traveling from A->D given the following options?

  1. You can follow the line segments to travel, which costs you $1/unit_distance
  2. You can ‘jump’ from some point on any line segment to some other point on some other line segment, which costs you $2/unit_distance covered in that ‘jump’ and then again choose between option #1 and option #2 for remaining journey.

The line segments are lines in 2D.

e.g. Suppose that you need to travel from (0,0)->(2,2)->(2,-2). There are many options to do this. I am listing 3 below:

  1. If you follow option #1 entirely, the cost is 2√2 (from (0,0) to (2,2)) + 4 (from (2,2) to (2,-2))
  2. If you jump from (0,0) to (2,-2), the distance covered is 2√2, and hence the cost is 4√2 ($2/unit for a jump).
  3. However, a better minimum cost would result if you jump from (0,0) to (2,-1) and then follow option #1 from (2,-1) to (2,-2) which costs you 2√5 (for the jump) + 1 (for following option #1).

The number of line segments might vary. I was thinking about formulating some LPP for this, but unable to proceed any further. Can someone please help me in finding the minima for such problems?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:50:01+00:00Added an answer on May 26, 2026 at 7:50 pm

    I don’t thing LPP can be used directly to solve the problem, because the distances are nonlinear, i.e. if you use as a distance measure for any point P on any of the line segments the distance from A following the line segments only, then the “hop” distance function that measures the cost of moving from a point P at distance x from A to another point P’ at distance x’ from A by “hopping”, say Hop(x, x’), is nonlinear in both x and x’ because the Euclidean distance metric is nonlinear.

    However, let’s assume first that there are only two segments (i.e. the path is A-B-C). The only possible pattern for a hop is to jump from the segment A-B to segment B-C, as it doesn’t make sense to hop within a single segment. Let the three points be at coordinates A=(ax,ay), B=(bx,by) and C=(cx,cy). Consider then a point P on segment A-B and point P’ on segment B-C so that the distance of P from A is d and the distance of P’ from B is d’. The distance from P to P’ through the segments is

    d' + AB - d
    

    where AB is the (constant) distance from A to B, and by hopping it is

    2 * sqrt((x - x')^2 + (y - y')^2)
    

    where

    x =  ax + d  * (bx - ax) / AB
    y =  ay + d  * (by - ay) / AB
    x' = bx + d' * (cx - bx) / BC
    y' = bx + d' * (cy - by) / BC
    

    where BC is the distance from B to C.

    The difference between the two distances is then

    2 * sqrt((x - x') (x - x') + (y - y') (y - y')) - d' + AB + d
    

    and I’m sure it can be solved for local minima by any standard techniques for such. The minima represent those pairs (P, P’) where the benefit of the hop over following the segments can’t be improved, and based on the geometry of the problem I’d really expect there to be only a finite number of such minimal pairs.

    This same approach can be used on any pair of two segments on the path as the fact that the segments are connected was not used, so in this fashion you can build up an equivalent network with finite branching (as suggested in one of the comments above), and then use simple path-finding algorithm to calculate the optimal result.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given the URL (single line): http://test.example.com/dir/subdir/file.html How can I extract the following parts using
Does anyone know an algorithm for the following problem: Given a undirected connected graph
Given two 2D line segments, A and B, how do I calculate the length
Given a directed, connected graph with only positive edge weights, are there faster algorithms
I will try and keep this short and to the point. Given the following
Possible Duplicate: Android How to draw a smooth line following your finger I'm new
I am using a vpn service from certain server. I was given with a
I want to parse the text line from the Wavefront OBJ file . Currently
Warning: mysqli_close() expects parameter 1 to be mysqli, object given in /home/mjcrawle/public_html/toga/homefile/processlogin.php on line
This walkthrough says you can create a WPF datagrid in one line but doesn't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.