# Tagged Questions

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

1answer
2k views

### How to construct a treemap using non-rectangles?

I've written the standard version of a tree map (a graphic that shows nested data) and I'm looking to improve on this layout by switching to different types of polygons or perhaps circles. Can anyone ...
1answer
197 views

### Is there a way to characterize a winding object in an image?

I have produced this image by applying a Gaussian image substraction, Binarize, Colornegate, and ...
2answers
2k views

### How can I create a glass distortion effect in an image?

I'd like to overlay a glass jar onto an image with realistic light bending. Can anyone think of a way to automate this effect? Perhaps this can be done with the raytracing package Rayica / Optica?
3answers
169 views

### Given a list of triangle vertices, how to find the neighbors for each vertex?

A triangle is represented by {a,b,c}, indicting that its vertex IDs are a, b, and ...
1answer
174 views

### How to do automatic differentiation?

Does Mathematica have any AD functionality or does it only support symbolic differentiation? If not, are there any packages or other third party implementations available? Edit (J. M.) Here is an ...
1answer
53 views

### A question about the syntax [closed]

I have $3$ elementary questions to ask and I thank you in advance. Question N°1. What is the right syntax for $$y\equiv0\pmod {2}$$ in the code below? ...
1answer
150 views

### i need a swap mutation code (genetic algorithm) in Mathematica?

I'm working on GA coding to optimize the locators position in fixturing system to minimize the error in precision manufacturing.I need a code for mutation (genetic algorithm) in Mathematica. Here, I ...
1answer
120 views

### Challenging matrix sorting request?

I have an application in mind, and I need to do the following analysis, but am having a high degree of difficulty conceptualizing it in terms of syntax. I understand what I want, but cannot seem to ...
1answer
284 views

### Efficient algorithm to generate a basis for exact diagonalization

The problem is described as follows: I need to generate a basis(matrix) in lexicographic order. For two different basis vector $\{n_1,n_2,\cdots,n_M\}$ and $\{t_1,t_2,\cdots,t_M\}$, there must exist ...
1answer
412 views

### Efficiently find all connected subgraphs

Is there a way to generate all the connected subgraphs of a graph in mathematica without going through all the subsets of the nodes and checking if the subgraph is connected (which will be O(2^N)*O(...
5answers
1k views

### Check if a matrix is Positive Semidefinite

I have a question concerning the check whether a given matrix is positive semidefinite or not. In mathematica the function PositiveDefiniteMatrixQ[m] tells me ...
1answer
204 views

### Using the Baby-Step Giant-Step algorithm

Here is a concept I am working through: As part of an attack on an El-Gamal cipher, solving the discrete logarithm problem $$10^x = 532107 \;\, {\rm mod} \;\, 1313839.$$ Using the baby-...
3answers
897 views

### Computing Gaussian curvature

Can Gaussian curvature $K$ be computed from WolframAlpha or any other available Mathematica program? Please indicate the program or its reference. If input ...
0answers
71 views

### 3-adic FFT algorithm

I am trying to implement the FFT algorithm when $n=3^k$, but maybe my code is wrong. Are there any suggestions for improving my code? ...
0answers
244 views

### Integration of graphs with datasets

Mathematica has a rich family of graph algorithms. I would like to leverage some of these for a very large tree structure. Because of the size of the structure, I would like to store it in a Dataset ...
2answers
170 views

### Replace missing data

I have vectors of equal lengths where I want to replace the zeroes (missing data) with their preceding values. So far I have written: ...
1answer
296 views

### Spectral Clustering

I am attempting to implement a spectral clustering routine using Mathematica, but I am encountering difficulties. Using the standard Gaussian similarity function found in section 2.2 of this paper ...
0answers
147 views

### How to write my own interpolation method [duplicate]

I was comparing results of spline interpolation in Mathematica and C++/gsl-library Results of interpolation are different if I use ...
0answers
110 views

### AVL binary search tree implementation

Is there any text-book implementation of self-balancing binary search trees such as AVL or red-black in Mathematica?
1answer
131 views

### Maximizing the number of zero entries in a matrix

I have a matrix with a bunch of parameters in its entries, they all come in different combinations in different places of the matrix. I can post the matrix itself if requested, but I think what I mean ...
1answer
46 views

### Algorithm in Module behaves different [closed]

In my Notebook i wrote this algorithm: ...
4answers
651 views

### Efficient way to sum all the primes below $N$ million in Mathematica

Today, I saw a problem described as below: Sum all primes below $N$ million At the beginning, I feel it is rather simple to calculate it in Mathematica ...
7answers
1k views

### Splitting words into specific fragments

I am looking into splitting words into a succession of chemical elements symbols, where possible. For example: Titanic = Ti Ta Ni C (titanium, tantalum, nickel, carbon) A word may or may not be ...
2answers
2k views