Solutions of a system of linear equations

In summary, this conversation discusses a hybrid simulation-optimization problem involving a Hamiltonian cycle in a two-dimensional Euclidean space. The problem involves a system of linear equations with constraints and a specific structure. The question posed is how many solutions a generalized version of this system has and if there is a fast way to find these solutions. Several approaches are discussed, but it is uncertain if a generalized solution exists due to the unique structure of each simulation. The problem is motivated by finding a different method for determining the number of Hamiltonian paths between two points in a square lattice for a neural network learning task.
  • #1
h6ss
77
9
Hello,

I am working on a hybrid simulation-optimization problem of a hamiltonian cycle in two-dimensional Euclidean space, and have encountered the following problem:

Say I have a system of N linear equations and M unknowns, where M > N, with the following constraints:

1. Every coefficient of every unknown has to be equal to 1;
2. Every unknown appears exactly twice;
3. There are exactly two equations of the form xi + xj = 1;
4. All the other equations are equal to 2;
5. Every equation must have at least 2 unknowns;
6. The unknowns are expected results of a Heaviside step function, therefore they can only take the values 0 or 1.

Also, if you sum all the equations and divide both sides by 2, you get:

[tex]\sum_{i=1}^{M} x_{i} = N-1[/tex]

Therefore, for any solution, there will be exactly (N - 1) 1's and (M - (N - 1)) 0's.

Here is an example of such system where N = 11 and M = 15:

1 = x1 + x4
2 = x2 + x3 + x10
2 = x5 + x3 + x14
2 = x1 + x5 + x6 + x8
2 = x7 + x9 + x11
2 = x9 + x13
2 = x4 + x12 + x13 + x15
2 = x10 + x11
2 = x2 + x8 + x15
2 = x6 + x12
1 = x7 + x14

My question is, how many solutions does a generalized version of this system has?

Is there a fast way to find these solutions? A deterministic algorithm of any kind?

The only programming software I'm good with is R, and I haven't found a way to simulate this on R's platform yet.

Thanks in advance!
 
Last edited:
Physics news on Phys.org
  • #2
For small size problems, a "brute force" idea would be to do an elimination procedure to express all the variables in terms of ##M-N## "master" variables, and then use trial and error for the ##2^{M-N}## possiible solution sets.

But for your example problem, you get several values direct from the equations and the constraint that the solutions are all 0 or 1:

##x_9 = x_{13} = 1##, ##x_{10} = x_{11} = 1##, ##x_6 = x_{12} = 1##.

Substituting in those values, you get some more values ... is there something general about the structure of the equations that you can exploit here?

A completely different approach would be to add the equations ##x_k(1-x_k) = 0##, ##k = 1\dots M## and throw everything at a nonlinear equation solver. But that might run into problems finding all possible solutions.
 
  • Like
Likes 1 person
  • #3
AlephZero said:
Substituting in those values, you get some more values ... is there something general about the structure of the equations that you can exploit here?

Most likely there is, and this method would simplify my specific example, but I believe every simulation will have its own unique structure, therefore it will be hard to extrapolate a generalized structure from only a limited number of simulations, wouldn't it? I've tried running thousands of simulations and look for common structure between one and another and I haven't been able to find something interesting yet.

AlephZero said:
A completely different approach would be to add the equations ##x_k(1-x_k) = 0##, ##k = 1\dots M## and throw everything at a nonlinear equation solver. But that might run into problems finding all possible solutions.

That's interesting. It's a pretty accurate method in my opinion, but only to solve a particular system. I'm looking for a method that would solve (or at least attempt to) for fixed but unknown values of M and N.

After some time working on this problem I have started being rather pessimistic about finding all solutions in practice. Some people said that the counting problem is #P-hard and a lattice-point enumeration problem of this kind is probably impossible to solve. How accurate are those claims?

I'm starting to believe that I might be able to do better by exploiting the structure of specific simulations, but I wouldn't know where to start. I'd be interested in suggestions about this if anyone has any idea. Thank you!
 
  • #4
I'm curious to know what motivated this problem, and specifically, how it is related to the Hamiltonian path/cycle problems?

BiP
 
  • #5
Bipolarity said:
I'm curious to know what motivated this problem, and specifically, how it is related to the Hamiltonian path/cycle problems?

BiP

For the learning of a neural network, I am trying to find a different method to determine the number of hamiltonian paths between two chosen points in a square lattice.

In this system, each variable corresponds to an edge and each equation illustrates the "behaviour" of the system at every point. Basically, every variable appears exactly twice because every edge connects two points. The starting and ending points are equal to 1 because the operation around them is unidirectional, while all the other equations are equal to 2 because they operate bidirectionally.

More exactly, a two-dimensional finite square lattice is generated to help represent the different paths available from a chosen starting point to a chosen ending point. The paths are hamiltonian because each simulation requires our neural network to visit every point exactly once. In the end, we want to teach the network to take an autonomous and optimized decision according to the number of paths found. A generalized solution for the system would give us an idea of how the network would behave knowing only the starting/ending points, independently of the distance that separates them.
 

Related to Solutions of a system of linear equations

1. What is a system of linear equations?

A system of linear equations is a set of two or more equations that contain two or more variables. The goal is to find a set of values for the variables that satisfy all of the equations simultaneously.

2. How do you solve a system of linear equations?

There are several methods for solving a system of linear equations, including substitution, elimination, and graphing. These methods involve manipulating the equations to eliminate one variable and solve for the others.

3. What is the difference between consistent and inconsistent systems of linear equations?

A consistent system of linear equations has at least one solution, meaning that the equations intersect at a single point. An inconsistent system of linear equations has no solution, meaning that the equations do not intersect at any point.

4. Can a system of linear equations have more than one solution?

Yes, a system of linear equations can have one, infinite, or no solutions. One solution occurs when the equations intersect at a single point, infinite solutions occur when the equations are equivalent and overlap, and no solutions occur when the equations are parallel and do not intersect.

5. How is a system of linear equations used in real life?

A system of linear equations is used to model and solve many real-life problems, such as determining the cost of a shopping trip with different items and prices, finding the optimal production levels for a company, and calculating the amount of ingredients needed for a recipe.

Similar threads

  • Calculus and Beyond Homework Help
Replies
1
Views
893
  • Linear and Abstract Algebra
Replies
4
Views
1K
  • Linear and Abstract Algebra
Replies
3
Views
956
  • Linear and Abstract Algebra
Replies
11
Views
1K
  • Linear and Abstract Algebra
Replies
5
Views
1K
  • Precalculus Mathematics Homework Help
Replies
3
Views
3K
  • Linear and Abstract Algebra
Replies
9
Views
2K
  • Linear and Abstract Algebra
Replies
1
Views
781
  • Linear and Abstract Algebra
Replies
4
Views
1K
Replies
10
Views
409
Back
Top