# SFS_read: Read similarity or dissimilarity input data In SFS: Similarity-First Search Seriation Algorithm

## Description

Read the similarity (or dissimilarity) information between the objects that one wants to order and build a 3-columns `data frame`, where each row (i, j, A_{ij}) represents the (dis)similarity A_{ij} between objects i and j. In case of symmetric data (i.e., A_{ij} = A_{ji}), only the entries for pairs (i,j) with i<j are listed.

## Usage

 `1` ```read(data, zero_epsilon = 1e-200, symmetric = TRUE, identical_val = FALSE) ```

## Arguments

 `data` a representation of the similarity (or dissimilarity) between pairs of objects. `zero_epsilon` a numerical value which determines that values in `data` below this threshold are considered to be `0`. `symmetric` a boolean value equal to `TRUE` if the input data is a symmetric matrix (i.e., A_{ij} = A_{ji} for all i and j). `identical_val` a boolean value equal to `TRUE` if the data is given as a 3-columns `data frame` and entries at both positions (i,j) and (j,i) are included.

## Details

The input data can be a weighted adjacency matrix (represented by the objects: `matrix`, `dist` or `data frame`), or a list of all the weighted edges of a weighted graph (represented by a 3-col `data frame`) where each row (i, j, A_{ij}) represents the (dis)similarity A_{ij} between objects i and j with i<j). If not specified, the data is assumed to be symmetric (i.e., same entry at positions (i,j) and (j,i)). Since by default the data is assumed to be symmetric, if it is represented by a 3-columns `data frame`, then it is assumed that symmetric pairs are not listed, and thus by default `identical_val = FALSE`. The reason for this choice is that for large symmetric data, it is more efficient to list the symmetric entries only once. However, note that if `symmetric = FALSE` then `identical_val = TRUE` automatically.

## Value

Returns a 3-columns `data frame` representation of the original data listing all the pairwise (dis)similarities (i, j, A_{ij}) between objects and selecting only the entries A_{ij} with i<j when the data is a symmetric matrix A.

## Author(s)

Matteo Seminaroti (SFS) and Utz-Uwe Haus (R wrapping)

SFS documentation built on May 7, 2019, 9:01 a.m.