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

  • SEARCH
  • Home
  • 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 6895757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:56:59+00:00 2026-05-27T06:56:59+00:00

I have accounts with positive and negative balance and a pledge relationship between some.

  • 0

I have accounts with positive and negative balance and a pledge relationship between some. A pledge gives accounts with negative balance the right to retrieve money from the pledging account to cover their loss.

I want to find the optimal order of invoking this right of retrieving money.

            1    2    3
A 1000 | -1000 -500 -500
B 1000 | -1000

In the given example account A and B have a positive balance of 1000 and accounts 1,2,3 are covered by priority (1 > 2 > 3). I want to cover as many accounts as possible by distributing the money of A and B on 1,2,3 while honoring the priority.

In this particular example choosing A1 as my first pair would result in only covering 1000 but if I choose B1, A2, A3 I have the optimal solution of covering 2000.

How is this kind of optimization problem called and what are the algorithms to tackle it?

  • 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-27T06:56:59+00:00Added an answer on May 27, 2026 at 6:56 am

    It’s basically a network flow problem. I’ll draw the capacitated graph for your example (unlabeled arcs have infinite capacity). s is the source and t is the sink.

         >A------->1
    1000/ |\       ^\
       /  | \     /  \1000
      /   |  \   /    \
     /    |   \ /  500 v
    s     |    /->2--->t
     \     \  /        ^
      \     \/        /
       \    /\       /500
    1000\  /  \     /
         >B    --->3
    

    The answer isn’t the max flow; it’s the flow that maximizes 1, then 2, then 3. One poly-time algorithm is to modify a max flow algorithm based on augmenting paths (simple paths!—otherwise we might take flow away from a higher priority account) preferentially to augment paths via 1, then 2, then 3.

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

Sidebar

Related Questions

I am making a program like yelp. Some people have some accounts. So I
I have 2 models, Users & Accounts. They are in one-to-many relationship, i.e. each
i am trying to return a list of users whose accounts have expired from
I have a typical HABTM relationship between members (actual members of our organization, not
I have accounts which they have some settings attributes. As settings there are value
I have a file numbers.dat containing about 300 numbers(floating point,negative positive)in column format. The
i have an accounts class from that i have 3 types of accounts savings,
I have verious accounts which need to be kept track of. These accounts are
I have an accounts model as follows (simplified): class Account < ActiveRecord::Base attr_accessible :account_number,
In my routes I have: resources :accounts This produces: accounts GET /accounts(.:format) accounts#index POST

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.