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 7763995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:48:02+00:00 2026-06-01T14:48:02+00:00

I have two sets of vectors, set A and set B. Let’s say set

  • 0

I have two sets of vectors, set A and set B. Let’s say set A contains 100 vectors and set B contains 50 vectors. I have my own way of measuring the distance between any two vectors. The objective is to map a vector in set A to that vector in set B with which the distance is within a particular threshold. Now, if the distance between two vectors is not within a particular threshold, then they are not paired. The mapping is one-one, i.e. a vector in set A can be mapped only to one vector in set B and vice-versa.

So, it may happen that finally, 40 vectors from set A are mapped to 40 vectors in set B. Thus, 60 vectors in set A are not paired with any vectors in set B. Hence, 10 vectors in set B are also left unpaired.

Now, if I label the vectors in set A as A1, A2, A3 … A100 and vectors in set B as B1, B2, B3 … an so on, what is the most efficient way of iterating through the two sets and doing this pairing.

Please let me know if it requires additional clarifications.

  • 1 1 Answer
  • 1 View
  • 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-06-01T14:48:03+00:00Added an answer on June 1, 2026 at 2:48 pm

    What you need to do is first see which vectors from A can be paired with which vectors in B. This is done with O(n^2) complexity and will create a bipartite graph – you have two partitions of vertices – the vectors in A and the vectors in B and you have an edge if and only if a vector from A can be paired with a vector from B.
    After you have built the graph, you need to find maximum bipartite matching and this is usually done using a flow. Take a look here for instance. I personally use Dinitz algorithm for the flow.

    Hope this helps.

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

Sidebar

Related Questions

I have two sets A and B. Set A contains unique elements. Set B
I have two Sets. Set b is the subset of Set a . they're
I have two types of data sets. Both are in same size. One contains
I have a class that contains two sets. They both contain the same key
I have a project with two targets, let's say appA and appB . Both
I Have two sets of strings. set<string> A; set<string> B; I will insert some
Say I have two sets of XML elements: <One/> <Two/> <Three/> And <A/> <B/>
I regularly have two sets of pictures named the same way and I would
I have this problem in calculating Jaccard Distance for Sets (Bit-Vectors): p1 = 10111;
I have two sets of objects where in some cases the first set will

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.