Main > Free Download Search >

Free algorithm demo software for linux

algorithm demo

Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 1041
Algorithm::DiffOld 1.15

Algorithm::DiffOld 1.15


Algorithm::DiffOld is a Perl module to compute `intelligent differences between two files / lists but use the old interface. more>>
Algorithm::DiffOld is a Perl module to compute `intelligent differences between two files / lists but use the old ( $callback,
DISCARD_A => $callback,
DISCARD_B => $callback,
},
$comparison_function );

COMPARISON FUNCTIONS

Each of the main routines should be passed a comparison function. If you arent passing one in, use Algorithm::Diff instead.

These functions should return a true value when two items should compare as equal.

For instance,

@lcs = LCS( @seq1, @seq2, sub { my ($a, $b) = @_; $a eq $b } );

but if that is all youre doing with your comparison function, just use Algorithm::Diff and let it do this (this is its default).

Or:

sub someFunkyComparisonFunction
{
my ($a, $b) = @_;
$a =~ m{$b};
}

@diffs = diff( @lines, @patterns, &someFunkyComparisonFunction );

which would allow you to diff an array @lines which consists of text lines with an array @patterns which consists of regular expressions.

This is actually the reason I wrote this version -- there is no way to do this with a key generation function as in the stock Algorithm::Diff.

<<less
Download (0.023MB)
Added: 2007-08-01 License: Perl Artistic License Price:
814 downloads
Algorithm::Permute 0.06

Algorithm::Permute 0.06


Algorithm::Permute is a Perl module with handy and fast permutation with object oriented interface. more>>
Algorithm::Permute is a Perl module with handy and fast permutation with object oriented interface.

SYNOPSIS

use Algorithm::Permute;

my $p = new Algorithm::Permute([a..d]);
while (@res = $p->next) {
print join(", ", @res), "n";
}

my @array = (1..9);
Algorithm::Permute::permute { print "@arrayn" } @array;

This handy module makes performing permutation in Perl easy and fast, although perhaps its algorithm is not the fastest on the earth. Currently it only supports permutation n of n objects.

No exported functions. This version is not backward compatible with the previous one, version 0.01. The old interface is no longer supported.

METHODS

new [@list]

Returns a permutor object for the given items.

next

Returns a list of the items in the next permutation. The order of the resulting permutation is the same as of the previous version of Algorithm::Permute.

peek

Returns the list of items which will be returned by next(), but doesnt advance the sequence. Could be useful if you wished to skip over just a few unwanted permutations.

reset

Resets the iterator to the start. May be used at any time, whether the entire set has been produced or not. Has no useful return value.

<<less
Download (0.010MB)
Added: 2007-05-17 License: Perl Artistic License Price:
892 downloads
Algorithm::LUHN 1.00

Algorithm::LUHN 1.00


Algorithm::LUHN is a Perl module to calculate the modulus 10 double add double checksum. more>>
Algorithm::LUHN is a Perl module to calculate the modulus 10 double add double checksum.

SYNOPSIS

use Algorithm::LUHN qw/check_digit is_valid/;

$c = check_digit("43881234567");
print "It worksn" if is_valid("43881234567$c");

$c = check_digit("A2C4E6G8"); # this will cause an error

print "Valid LUHN characters are:n";
my %vc = Algorithm::LUHN::valid_chars();
for (sort keys %vc) {
print "$_ => $vc{$_}n";
}

Algorithm::LUHN::valid_chars(map {$_ => ord($_)-ord(A)+10} A..Z);
$c = check_digit("A2C4E6G8");
print "It worked againn" if is_valid("A2C4E6G8$c");

This module calculates the Modulus 10 Double Add Double checksum, also known as the LUHN Formula. This algorithm is used to verify credit card numbers and Standard & Poors security identifiers such as CUSIPs and CSINs.

You can find plenty of information about the algorithm by searching the web for "modulus 10 double add double".

<<less
Download (0.004MB)
Added: 2007-05-16 License: Perl Artistic License Price:
893 downloads
mcl-algorithm 06-021

mcl-algorithm 06-021


mcl-algorithm is a scalable cluster algorithm for graphs based on stochastic flow. more>>
mcl-algorithm is a scalable cluster algorithm for graphs based on stochastic flow.
The flow process employed by the algorithm is mathematically sound and intrinsically tied to cluster structure in graphs, which is revealed as the imprint left by the process.
The threaded implementation has handled graphs of up to one million nodes within hours, and is widely used in the field of protein family analysis. It comes with a wide range of sibling utilities for handling and analyzing graphs, matrices, and clusterings.
The MCL algorithm simulates flow using (alternating) two simple algebraic operations on matrices. Its formulation is simple and elegant. There are no high-level procedural instructions for assembling, joining, or splitting of groups - cluster structure is bootstrapped via a flow process that is inherently affected by any cluster structure present.
The first operation used by MCL is expansion, which coincides with normal matrix multiplication. Expansion models the spreading out of flow, it becoming more homogeneous. The second is inflation, which is mathematically speaking a Hadamard power followed by a diagonal scaling. Inflation models the contraction of flow, it becoming thicker in regions of higher current and thinner in regions of lower current. The MCL process causes flow to spread out within natural clusters and evaporate inbetween different clusters.
- By varying parameters, clusterings on different scales of granularity can be found. The number of clusters can not and need not be specified in advance, but the algorithm can be adapted to different contexts.
- The issue how many clusters? is not dealt with in an arbitrary manner, but rather by strong internal logic. Cluster structure leaves its marks on the flow process simulated by the algorithm, and the flow parameters control the granularity of the cluster imprint.
- The limit of the MCL process (the process simulated by the algorithm) is in general extremely sparse, and the iterands are sparse in a weighted sense. This gives the means to scale the algorithm drastically, leading to a worst-case complexity of order Nk^2, where N is the number of nodes of the input graph, and where k is a threshold for the number of resources allocated per node.
- The rate of convergence of the MCL process, and projection of the iterands afterwards onto the resulting clustering, give hooks for unsupervised parameter adjustment.
- The iterands of the MCL process have structural properties which allow a cluster interpretation, and which generalize the mapping of MCL limits onto clusterings. The mathematics associated with the MCL process shows that there is an intrinsic relationship between the MCL process and cluster structure in graphs. This is very valuable given the many heuristic approaches in cluster analysis.
Enhancements:
- Numerous cleanups in much of the code.
- Improvements in caching intermediate results.
<<less
Download (1.1MB)
Added: 2006-01-24 License: GPL (GNU General Public License) Price:
1370 downloads
Algorithm::Merge 0.08

Algorithm::Merge 0.08


Algorithm::Merge is a Perl module package that provides three-way merge and diff. more>>
Algorithm::Merge is a Perl module package that provides three-way merge and diff.

SYNOPSIS

use Algorithm::Merge qw(merge diff3 traverse_sequences3);

@merged = merge(@ancestor, @a, @b, {
CONFLICT => sub { }
});

@merged = merge(@ancestor, @a, @b, {
CONFLICT => sub { }
}, $key_generation_function);

$merged = merge(@ancestor, @a, @b, {
CONFLICT => sub { }
});

$merged = merge(@ancestor, @a, @b, {
CONFLICT => sub { }
}, $key_generation_function);

@diff = diff3(@ancestor, @a, @b);

@diff = diff3(@ancestor, @a, @b, $key_generation_function);

$diff = diff3(@ancestor, @a, @b);

$diff = diff3(@ancestor, @a, @b, $key_generation_function);

@trav = traverse_sequences3(@ancestor, @a, @b, {
# callbacks
});

@trav = traverse_sequences3(@ancestor, @a, @b, {
# callbacks
}, $key_generation_function);

$trav = traverse_sequences3(@ancestor, @a, @b, {
# callbacks
});

$trav = traverse_sequences3(@ancestor, @a, @b, {
# callbacks
}, $key_generation_function);

USAGE

This module complements Algorithm::Diff by providing three-way merge and diff functions.

In this documentation, the first list to diff3, merge, and traverse_sequences3 is called the `original list. The second list is the `left list. The third list is the `right list.

The optional key generation arguments are the same as in Algorithm::Diff. See Algorithm::Diff for more information.

<<less
Download (0.010MB)
Added: 2007-05-16 License: Perl Artistic License Price:
892 downloads
Algorithm::Loops 1.031

Algorithm::Loops 1.031


Algorithm::Loops is a Perl module with looping constructs: NestedLoops, MapCar*, Filter, and NextPermute*. more>>
Algorithm::Loops is a Perl module with looping constructs: NestedLoops, MapCar*, Filter, and NextPermute*.

SYNOPSYS

use Algorithm::Loops qw(
Filter
MapCar MapCarU MapCarE MapCarMin
NextPermute NextPermuteNum
NestedLoops
);

my @copy= Filter {tr/A-Z.,"()/a-z/d} @list;
my $string= Filter {s/s*$/ /} @lines;

my @transposed= MapCarU {[@_]} @matrix;

my @list= sort getList();
do {
usePermutation( @list );
} while( NextPermute( @list ) );

my $len= @ARGV ? $ARGV[0] : 3;
my @list= NestedLoops(
[ ( [ 1..$len ] ) x $len ],
sub { "@_" },
);

If you want working sample code to try, see below in the section specific to the function(s) you want to try. The above samples only give a feel for how the functions are typically used.

<<less
Download (0.022MB)
Added: 2006-10-12 License: Perl Artistic License Price:
1107 downloads
Algorithm::Diff 1.1902

Algorithm::Diff 1.1902


Algorithm::Diff is a Perl module to compute `intelligent differences between two files / lists. more>>
Algorithm::Diff is a Perl module to compute `intelligent differences between two files / lists.

SYNOPSIS

require Algorithm::Diff;

# This example produces traditional diff output:

my $diff = Algorithm::Diff->new( @seq1, @seq2 );

$diff->Base( 1 ); # Return line numbers, not indices
while( $diff->Next() ) {
next if $diff->Same();
my $sep = ;
if( ! $diff->Items(2) ) {
printf "%d,%dd%dn",
$diff->Get(qw( Min1 Max1 Max2 ));
} elsif( ! $diff->Items(1) ) {
printf "%da%d,%dn",
$diff->Get(qw( Max1 Min2 Max2 ));
} else {
$sep = "---n";
printf "%d,%dc%d,%dn",
$diff->Get(qw( Min1 Max1 Min2 Max2 ));
}
print "< $_" for $diff->Items(1);
print $sep;
print "> $_" for $diff->Items(2);
}


# Alternate interfaces:

use Algorithm::Diff qw(
LCS LCS_length LCSidx
diff sdiff compact_diff
traverse_sequences traverse_balanced );

@lcs = LCS( @seq1, @seq2 );
$lcsref = LCS( @seq1, @seq2 );
$count = LCS_length( @seq1, @seq2 );

( $seq1idxref, $seq2idxref ) = LCSidx( @seq1, @seq2 );


# Complicated interfaces:

@diffs = diff( @seq1, @seq2 );

@sdiffs = sdiff( @seq1, @seq2 );

@cdiffs = compact_diff( @seq1, @seq2 );

traverse_sequences(
@seq1,
@seq2,
{ MATCH => &callback1,
DISCARD_A => &callback2,
DISCARD_B => &callback3,
},
&key_generator,
@extra_args,
);

traverse_balanced(
@seq1,
@seq2,
{ MATCH => &callback1,
DISCARD_A => &callback2,
DISCARD_B => &callback3,
CHANGE => &callback4,
},
&key_generator,
@extra_args,
);

<<less
Download (0.033MB)
Added: 2007-06-28 License: Perl Artistic License Price:
848 downloads
Algorithm::BinPack 0.5

Algorithm::BinPack 0.5


Algorithm::BinPack is a Perl module that can efficiently pack items into bins. more>>
Algorithm::BinPack is a Perl module that can efficiently pack items into bins.

SYNOPSIS

Algorithm::BinPack efficiently packs items into bins. The bins are given a maximum size, and items are packed in with as little empty space as possible. An example use would be backing up files to CD, while minimizing the number of discs required.

my $bp = Algorithm::BinPack->new(binsize => 4);

$bp->add_item(label => "one", size => 1);
$bp->add_item(label => "two", size => 2);
$bp->add_item(label => "three", size => 3);
$bp->add_item(label => "four", size => 4);

for ($bp->pack_bins) {
print "Bin size: ", $_->{size}, "n";
print " Item: ", $_->{label}, "n" for @{ $_->{items} };
}

METHODS

new

Creates a new Algorithm::BinPack object. The maximum bin size is specified as a named argument binsize, and is required. A fudge factor may be specified as a named argument fudge. If a fudge factor is specified, item sizes will be rounded up to a number divisible by the fudge factor. This can help keep items with similar sizes in order by their labels.

my $bp = Algorithm::BinPack->new(binsize => 4);
my $bp = Algorithm::BinPack->new(binsize => 100, fudge => 10);

add_item

Adds an item to be packed into a bin. Required named arguments are label and size, but any others can be specified, and will be saved. An optional bin argument can be used to manually put an item into the specified bin.

$bp->add_item(label => one, size => 1);
$bp->add_item(label => two, size => 2, desc => The second numeral);
$bp->add_item(label => zero, size => 3, bin => 0);
$bp->add_item(qw(label three size 3));
$bp->add_item(qw(label four size 4 random key));

prefill_bin

(Deprecated method) add_item now knows how to handle the bin argument directly, so this method is redundant.

pack_bins

Packs the items into bins. This method tries to leave as little empty space in each bin as possible. It returns a list of hashrefs with the key size containing the total bin size, and items containing an arrayref holding the items in the bin. Each item is in turn a hashref containing the keys label, size, and any others added to the item. If a fudge factor was used, each item will contain a key fudgesize, which is the size this item was fudged to.

for my $bin ($bp->pack_bins) {
print "Bin size: ", $bin->{size}, "n";

for my $item (@{ $bin->{items} }) {
printf " %-6s %-20sn", $_, $item->{$_} for keys %{ $item };
print " ---n";
}
}

<<less
Download (0.004MB)
Added: 2007-05-16 License: Perl Artistic License Price:
891 downloads
Algorithm::SISort 0.14

Algorithm::SISort 0.14


Algorithm::SISort is a Perl module that contains select and insert sorting algorithm. more>> <<less
Download (0.004MB)
Added: 2007-05-17 License: Perl Artistic License Price:
890 downloads
Algorithm::SixDegrees 0.03

Algorithm::SixDegrees 0.03


Algorithm::SixDegrees is a Perl module that can find a path through linked elements in a set. more>>
Algorithm::SixDegrees is a Perl module that can find a path through linked elements in a set.

SYNOPSIS

use Algorithm::SixDegrees;

my $sd1 = Algorithm::SixDegrees->new();
$sd1->data_source( actors => &starred_in );
$sd1->data_source( movies => &stars_of );
@elems = $sd1->make_link(actors, Tom Cruise, Kevin Bacon);

my $sd2 = Algorithm::SixDegrees->new();
$sd2->forward_data_source( friends => &friends, @args );
$sd2->reverse_data_source( friends => &friend_of, @args );
@elems = $sd2->make_link(friends, Bob, Mark);

Algorithm::SixDegrees is a Perl implementation of a breadth-first search through a set of linked elements in order to find the shortest possible chain linking two specific elements together.

In simpler terms, this module will take a bunch of related items and attempt to find a relationship between two of them. It looks for the shortest (and generally, simplest) relationship it can find.

<<less
Download (0.011MB)
Added: 2007-05-17 License: Perl Artistic License Price:
891 downloads
Algorithm::Cluster 1.35

Algorithm::Cluster 1.35


Algorithm::Cluster is a Perl interface to the C Clustering Library. more>>
Algorithm::Cluster is a Perl interface to the C Clustering Library.

This module is an interface to the C Clustering Library, a general purpose library implementing functions for hierarchical clustering (pairwise simple, complete, average, and centroid linkage), along with k-means and k-medians clustering, and 2D self-organizing maps.

This library was developed at the Human Genome Center of the University of Tokyo. The C Clustering Library is distributed along with Cluster 3.0, an enhanced version of the famous Cluster program originally written by Michael Eisen while at Stanford University.

<<less
Download (0.048MB)
Added: 2007-05-16 License: Perl Artistic License Price:
894 downloads
Algorithm::Huffman 0.09

Algorithm::Huffman 0.09


Algorithm::Huffman is a Perl extension that implements the Huffman algorithm. more>>
Algorithm::Huffman is a Perl extension that implements the Huffman algorithm.

SYNOPSIS

use Algorithm::Huffman;

my %char_counting = map {$_ => int rand(100)} (a .. z, A .. Z);
# or better the real counting for your characters
# as the huffman algorithm doesnt work good with random data :-))

my $huff = Algorithm::Huffman->new(%char_counting);
my $encode_hash = $huff->encode_hash;
my $decode_hash = $huff->decode_hash;

my $encode_of_hello = $huff->encode_bitstring("Hello");

print "Look at the encoding bitstring of Hello: $encode_of_hellon";
print "The decoding of $encode_of_hello is ", $huff->decode_bitstring($encode_of_hello), "";

This modules implements the huffman algorithm. The aim is to create a good coding scheme for a given list of different characters (or even strings) and their occurence numbers.

ALGORITHM

Please have a look to a good data compression book for a detailed view. However, the algorithm is like every good algorithm very easy.

Assume we have a heap (keys are the characters/strings; values are their occurencies). In each step of the algorithm, the two rarest characters are looked at. Both get a suffix (one "0", the other "1"). They are joined together and will occur from that time as one "element" in the heap with their summed occurencies. The joining creates a tree growing on while the heap is reducing.
Lets take an example. Given are the characters and occurencies.

a (15) b(7) c(6) d(6) e(5)

In the first step e and d are the rarest characters, so we create this new heap and tree structure:

a(15) de(11) b(7) c(6)

de
/
"0"/ "1"
d e

Next Step:

a(15) bc(13) de(11)

de bc
/ /
"0"/ "1" "0"/ "1"
d e b c

Next Step:

a(15) bcde(24)

bcde
/
"0"/ "1"
/
de bc
/ /
"0"/ "1" "0"/ "1"
d e b c

Next Step unifies the rest:

Huffman-Table
/
"0"/ "1"
/
/
bcde a
/
"0"/ "1"
/
de bc
/ /
"0"/ "1" "0"/ "1"
d e b c

Finally this encoding table would be created:

a 1
b 010
c 011
d 000
e 001

Please note, that there is no rule defining what element in the tree is ordered to left or to right. So its also possible to get e.g. the coding scheme:

a 0
b 100
c 101
d 110
e 111

<<less
Download (0.008MB)
Added: 2007-07-12 License: Perl Artistic License Price:
837 downloads
Algorithm::Munkres 0.06

Algorithm::Munkres 0.06


Algorithm::Munkres is a Perl extension for Munkres solution to classical Assignment problem for square and rectangular matrices more>>
Algorithm::Munkres is a Perl extension for Munkres solution to classical Assignment problem for square and rectangular matrices. This module extends the solution of Assignment problem for square matrices to rectangular matrices by padding zeros. Thus a rectangular matrix is converted to square matrix by padding necessary zeros.

SYNOPSIS

use Algorithm::Munkres;
@mat = (
[2, 4, 7, 9],
[3, 9, 5, 1],
[8, 2, 9, 7],
);
assign(@mat,@out_mat);

Then the @out_mat array will have the output as: (0,3,1,2), where 0th element indicates that 0th row is assigned 0th column i.e value=2

1st element indicates that 1st row is assigned 3rd column i.e.value=1
2nd element indicates that 2nd row is assigned 1st column.i.e.value=2
3rd element indicates that 3rd row is assigned 2nd column.i.e.value=0

Assignment Problem: Given N jobs, N workers and the time taken by each worker to complete a job then how should the assignment of a Worker to a Job be done, so as to minimize the time taken.

Thus if we have 3 jobs p,q,r and 3 workers x,y,z such that:
x y z
p 2 4 7
q 3 9 5
r 8 2 9

where the cell values of the above matrix give the time required for the worker(given by column name) to complete the job(given by the row name)

then possible solutions are:

Total
1. 2, 9, 9 20
2. 2, 2, 5 9
3. 3, 4, 9 16
4. 3, 2, 7 12
5. 8, 9, 7 24
6. 8, 4, 5 17

Thus (2) is the optimal solution for the above problem. This kind of brute-force approach of solving Assignment problem quickly becomes slow and bulky as N grows, because the number of possible solution are N! and thus the task is to evaluate each and then find the optimal solution.(If N=10, number of possible solutions: 3628800 !)

Munkres gives us a solution to this problem, which is implemented in this module.

This module also solves Assignment problem for rectangular matrices (M x N) by converting them to square matrices by padding zeros. ex:

If input matrix is:

[2, 4, 7, 9],
[3, 9, 5, 1],
[8, 2, 9, 7]

i.e 3 x 4 then we will convert it to 4 x 4 and the modified input matrix will be:

[2, 4, 7, 9],
[3, 9, 5, 1],
[8, 2, 9, 7],
[0, 0, 0, 0]

<<less
Download (0.009MB)
Added: 2007-05-29 License: Perl Artistic License Price:
881 downloads
IDS::Algorithm::MM 1.02

IDS::Algorithm::MM 1.02


IDS::Algorithm::MM is a Perl module created to learn or test using a first-order Markov Model (MM). more>>
IDS::Algorithm::MM is a Perl module created to learn or test using a first-order Markov Model (MM).

SYNOPSIS

A usage synopsis would go here. Since it is not here, read on.
In section 4.2 in Kruegel and Vignas paper, they ignored the probability information that the MM provided, and produced a binary result. In effect, they were using the constructed MM as a {N,D}FA.

Someday more will be here.

Ideally, we would be using the algorithm from stolcke94bestfirst. Constructing a DFA rather than a NFA in effect has performed most of the state merging that stolcke93hidden do.

Consider also a java or C/C++ implementaion: http://www.ghmm.org/ http://www.run.montefiore.ulg.ac.be/~francois/software/jahmm/

Useful information: http://www.cs.brown.edu/research/ai/dynamics/tutorial/Documents/HiddenMarkovModels.html http://www.comp.leeds.ac.uk/roger/HiddenMarkovModels/html_dev/main.html L R Rabiner and B H Juang, `An introduction to HMMs, IEEE ASSP Magazine, 3, 4-16.

printvcg

printvcg(filehandle)

Print in a form usable by VCG for printing the DFA.

If the filehandle is specified, print there; otherwise, print to STDOUT.
This code was stolen from DFA, and does not know about the probabilities.
load(filehandle)

Load a MM from a file; this is the inverse of "print", and the format we expect is that used in $self->print.

test(tokensref, string, instance)

Test the string of tokens and calculate the probability of the string being seen. At each stage, we get a p in [0,1]. The result is the product of these probabilities.
Note that if a transition cannot be made, we return a 0 probability.

add(tokensref, string, instance)

The collection of tokens (in the list referenced by tokensref) is a complete example of a list that should be accepted by the DFA.

string and instance are IDS::Test framework arguments that we ignore because we do not need them.

WE add the transition from the last token to the (ACCEPT) state.

add_transition(from, token)

Add a transition from one state to another when the specified token is received. It is not an error to try to add an existing transition. In that event, this function quietly returns. If no such transition exists, we look for a transition on the token; if so, we add an edge to the destination node for the existing edge. Finally, if there is no other choice, we create a new state and add the edge.

generalize()

Reduce the number of states in the model.

Our building a DFA rather than a NFA has in effect performed most of the state merging that would have occurred.

XXX We should still be doing some checks for additional merge possibilities.
XXX A proof that the DFA is effectively the NFA with merged states would be useful.

<<less
Download (0.032MB)
Added: 2007-06-18 License: Perl Artistic License Price:
858 downloads
Secleted [ 0 ] software to compare
  • Page: 1 of 5
  • 1
  • 2
  • 3
  • 4
  • 5