# Tagged Questions

An algorithm is a sequence of well-defined steps that defines in abstract the solution to a problem.

65 views

### Interpretation of a function

I know this is not great, as far as a question, but I came across this function, ...
159 views

### Finding all minimal paths in site percolation?

I want to find all minimal site percolation paths from the left side to the right side, small demo grid. A related question is here on finding bond percolation paths instead of minimal site ...
63 views

48 views

### Efficiently create a list of factors of consecutive integers

I'm interested in a scalable (read: sublinear) algorithm for producing the list of integer factors of each integer from 1 to n. ...
62 views

### Partial Derivative in FeynCalc

I try to compute some loop diagram in Mathematica with FeynCalc package. In the nominator, I have a huge trace and it shows the right solution but in the next step ...
115 views

### Generalizing LongestCommonSequence to 3 or more arguments?

The function LongestCommonSequence finds a longest common subsequence between 2 lists. Apparently, this built-in function does not accept more than 2 arguments. How ...
85 views

### Is it possible to use a function for EdgeWeight in a Graph?

Why I cannot calculate all edge weights beforehand: I have many large graphs for which I'd like to find the shortest path between two vertices (FindShortestPath ...
74 views

### Why is FindCycle crashing for this graph?

I'm working with a directed graph, previously mentioned in Exporting a high-resolution GraphPlot of a very large graph (65,536 nodes). It can be generated with the following code: ...
103 views

### FInding outliers in multiple dimensions

I'm working on dataset which isn't normally distributed.which contains three dimensions like cost, discount and profit I'm trying to find outliers in all these dimensions. I used z score to find ...
54 views

### Is this the right way to use for loop [closed]

Is this the right way to use for loop in order to find the sequence of $x_n$ ...
1k views

### Implement the Bisection algorithm elegantly and easily

Description: Rencently, I have finished my course Numerical Analysis, so I'd like to implement many algorithm that I have learned from that course.By this practice, I hope that I can improve my ...
32 views

### How to fix a procedure to work for another functions? [closed]

I have a procedure. It takes points and draws rectangles. The problem is to change the procedure to work not only with standarts functions. And the list of points must be : ...
447 views

### How to fill a grid make its total be largest

I have a blank grid whose dimension is 5*5. I want to fill it with some number using 1, 2, 3 and 4. But in every blank space if you fill 2, its neighbor (include four direction, such as left, right,...
151 views

### Refining subset relations

People who do combinatorics (like me) are often faced with the following problem: For a list of combinatorial objects (vectors, permutations graphs,etc.), we know what multi-set of values it ...
249 views

### A problem about recursion formula of de Casteljau algorithm

I use Mathematica to implement the de Casteljau algorithm $$\vec{P}_{k,i}(u_0)=(1-u_0)\vec{P}_{k-1,i}(u_0)+u_0\vec{P}_{k-1,i+1}(u_0)$$ The graphics that de Casteljau algorithm generated as follows: ...
1k views

### Higher order SVD

Does anyone know how to do a higher order SVD in Mathematica ? A good reference seems to be here http://www.sandia.gov/~tgkolda/pubs/pubfiles/SAND2007-6702.pdf but I don't understand their formalism ...
466 views

### Given a large binary matrix, find the largest submatrix containing non-zero elements

I'm looking for a way to reduce a binary matrix containing zeros at some positions into a matrix that contains no zeros by deleting rows and columns of the original matrix until only non-zero values ...
289 views

### A problem about Steffensen method

Two days ago,I asked a question about bisection algorithm. Thanks for Michael E2 giving me a good solution My algorithm 1, I use the bisection algorithm to generate a initial value that contain a ...
138 views

### Find random $n$ combinations of values with a given sum

This problem is described in the related StackOverflow question: Find all combinations of coins when given some dollar value. I would like generate a list of $n$ combinations of values that sum up to ...
165 views

### How to implement QLearning?

I know that v10 has support for both Machine Learning and Finite Markov Processes, the Q-learning algorithm uses both. Specifically, Q-learning finds an optimal action-selection policy for any given (...
199 views

### How to efficiently find all combinations of the letters in an alphabet given a condition

Problem: I want to find all unique expressions with n number of terms that contain all the digits (or characters) in alphabet. ...
100 views

### Interpolate the discrete list into continuous function

I have a data whose list plot shows up following graph I would like to interpolate the missing data and make the function continuous but for particular x-coordinate there is multiple values of $y$ ...
66 views

### How to replace the selected value in matrix with a specific digit?

I want to replace the selected values through "RandomChoice" by 1 and all other values in matrix with 0. I want output in binary form matirx. ...
3k views

### Finding all elements within a certain range in a sorted list

Suppose we have a sorted list of values. Let's use list = Sort@RandomReal[1, 1000000]; for this example. I need a fast function ...
147 views

### Extending a list

I have a range of n integers (always starting at 1) which are 1 apart, f.e. Range[10], Range[17] or ...
2k views

### Efficient implementation of cubic equation of state

...In this case the Peng Robinson Equation of State. Equations of state are empirical equations with parameters derived from experimental data. They are used to predict pure component and mixture ...
127 views

### How to solve lowest eigenvalue with Lanczos or Arnoldi algorithm? [closed]

By setting Method->Arnoldi in Eigensystem I was able to solve lowest eigenvalue and eigenstate of a large sparse matrix. ...
617 views

### Calculating an integral by the Romberg Algorithm

In my "Numerical Analysis" course, I learned the Romberg Algorithm to numerically calculate the integral. The Romberg Algorithm as shown below: T_{2n}(f)+\frac{1}{4^1-1}[T_{2n}(f)-T_{n}(f)]=...
10k views

### Programmatic approach to HDR photography with Mathematica image processing functions

The High dynamic range imaging (HDR or HDRI) direction in photography and image processing became very popular recently. Besides obvious photo art applications (see examples), there are many great ...
221 views

### Using mathematica to discover algorithms?

In Steven Wolfram's blog entries, he discusses using mathematica to discover algorithms. I have tried several different google searches for papers on such topics, and have found none. I suspect this ...
58 views

### Creating algorithm with several conditions

I'm pretty new to mathematica and was wondering if you guys could help me out. Example: We have the following coordinates: {1, 1}, {2, 1}, {3, 1}, {5, 1}, {1, 2}, {2, 2}, {3, 2}, where {x,y} And ...
215 views

### Random Partitions

I want to write a function RandomPartition to partition a vector of length n into p partitions of varying (random) lengths. For example with ...
102 views

### Smallest connected subgraph containing all given vertices

Given a connected graph $G$ and a subset of its vertices, $S$, I need to find the smallest connected subgraph of $G$ containing all of $S$. How would you approach this in Mathematica? I am asking ...
2k views

### How can I pack circles of different sizes into a spiral?

Given a list of circles of different areas, I need to arrange them tangentially in order of increasing area and spiraling outward. An example of the type of packing I'm attempting is shown by the ...
316 views

### Is there something akin to “SubgraphIsomorphismQ” in Mathematica 9?

Provided two unlabeled graphs, $G$ and $H$, I would like to test where $H$ is a subgraph of $G$. In other words, I'd like to test whether we can prune some fixed number of vertices or edges from $G$ ...
249 views

### Finding a complete subgraph efficiently

I'm working on some experimental algorithms which would benefit from methods to find an instance of complete subgraphs with N vertices in an undirected graph. This far I've tried these methods: <...
442 views

### Counting paths of a certain length between a source and sink vertex

I have a graph $G$, which may be directed or not, and I was wondering if there was an efficient way of using, say, BreadthFirstScan[] and FindShortestPath[] to count the number of paths between some ...
43 views

### Depth limited search in mathematica

I often use FindPath[G, 1, 2, {L}, All] where $G$ is some graph. This finds all paths of length exactly $L$ edges which run between nodes $1$ and $2$. In large ...
453 views

### Upper bound “Vicious nearest neighbour” algorithm suggestions

I am asking a question based on this question from the sister site MSE. In an effort to make this a self-contained question, I include the fiorst documented posing of the problem by Robert Abilock in ...
1k views

### Efficient way to build a certain square matrix

For odd n I'm looking for a short and swift way to construct with (f.e.) n = 3 n = 11 ...
428 views

### Determining whether two $k$-chromatic graphs are isomorphic (respecting vertex coloration)

Consider the case where I have two $k$-chromatic graphs $G_1$ and $G_2$, i.e. two graphs where individual vertices can be colored with one of a set of $k$ total colors, and I would like to determine ...
203 views

### Pollard's Rho algorithm

I'm working in Mathematica and I'm trying to implement the [Pollard's Rho Algorithm for the Discrete Logartihm Problem][1].
66 views

### Find the maximum hyperrectangle contained in a set of points

I have a question similar to this one ( Find the largest rectangular block satisfying some condition without iterating explicitly). but in my case I have a multidimensional (up to 6 dimensions) binary ...
37 views

### Algorithm to determine if two colored graphs are isomorphic? [duplicate]

I have two (vertex-)colored graphs. I want to determine if they are isomorphic, with the condition that the isomorphism respects the colors of the vertices. Moreover, I want the algorithm to output ...